*******************************************************************************
********************************* Setup ****************************************
********************************************************************************

* Set working directory *
***[Set working directory here]***


********************************************************************************
******************************* Figure 1 ***************************************
********************************************************************************

cls
use data_us, clear
reg elec_prom vote_sender, cluster(RecordNo)
estimates store send_us

reg elec_prom i.promise, cluster(RecordNo)
estimates store prom_us

reg elec_prom i.spec, cluster(RecordNo)
estimates store spec_us

reg elec_prom output, cluster(RecordNo)
estimates store out_us

reg elec_prom ib2.time, cluster(RecordNo)
estimates store time_us

reg elec_prom i.cond, cluster(RecordNo)
estimates store cond_us


use data_uk, clear
reg elec_prom vote_sender, cluster(RecordNo)
estimates store send_en

reg elec_prom i.promise, cluster(RecordNo)
estimates store prom_en

reg elec_prom i.spec, cluster(RecordNo)
estimates store spec_en

reg elec_prom output, cluster(RecordNo)
estimates store out_en

reg elec_prom ib2.time, cluster(RecordNo)
estimates store time_en

reg elec_prom i.cond, cluster(RecordNo)
estimates store cond_en


use data_dk, clear
reg elec_prom vote_sender, cluster(RecordNo)
estimates store send_dk

reg elec_prom i.promise, cluster(RecordNo)
estimates store prom_dk

reg elec_prom i.spec, cluster(RecordNo)
estimates store spec_dk

reg elec_prom output, cluster(RecordNo)
estimates store out_dk

reg elec_prom ib2.time, cluster(RecordNo)
estimates store time_dk

reg elec_prom i.cond, cluster(RecordNo)
estimates store cond_dk


coefplot(send_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(prom_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(spec_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(out_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(time_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(cond_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(send_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(prom_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(spec_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(out_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(time_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(cond_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(send_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(prom_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(spec_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(out_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(time_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(cond_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))), ///
drop(_cons) yscale(noline alt) grid(glcolor(gs6) glwidth(vthin)) ///
headings(vote_sender = "{bf:Sender}" 1.promise = "{bf:Committing statement}" 1.spec = "{bf:Numeric goal}" 1.time = "{bf:Time horizon}" output = "{bf:Output/outcome}" 1.cond = "{bf:Conditionality}", labgap(-93) nogap labsize(vsmall)) ///
xline(0, lcolor(black) lpattern(shortdash)) ytitle("", size(small)) levels(95) ///
graphregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white) margin(l=30)) coeflabels(, notick labgap(-90)) ///
xsize(14) ysize(20) xlabel(-0.25(0.05)0.2, labsize(vsmall)) ylabel(, labsize(vsmall)) baselevels legend(off) msymbol(o) 



graph export main_results_figure.png, width(3000) replace





********************************************************************************
*********************************** Figure 2 ***********************************
********************************************************************************

****************************** Conditionality **********************************

* Condition = economy *
use data_all, clear

* US *
local x cond_3 cond_4
local T cond_2
local M send_prior
local Y elec_prom
medeff (regress `M' `T' `x') (logit `Y' `T' `M' `x') if COUNTRY_DATA=="United States", treat(`T' 0 1) mediate(`M') sims(1000) vce(cluster RecordNo)
gen acme_con_pri_us = r(delta1)
gen acme_hi_con_pri_us = r(delta1hi)
gen acme_lo_con_pri_us = r(delta1lo)
gen acme_perc_con_pri_us = r(navg)


local x cond_3 cond_4
local T cond_2
local M pol_real
local Y elec_prom
medeff (regress `M' `T' `x') (logit `Y' `T' `M' `x') if COUNTRY_DATA=="United States", treat(`T' 0 1) mediate(`M') sims(1000) vce(cluster RecordNo)
gen acme_con_rea_us = r(delta1)
gen acme_hi_con_rea_us = r(delta1hi)
gen acme_lo_con_rea_us = r(delta1lo)
gen acme_perc_con_rea_us = r(navg)
  

local x cond_3 cond_4
local T cond_2
local M nocontr
local Y elec_prom
medeff (regress `M' `T' `x') (logit `Y' `T' `M' `x') if COUNTRY_DATA=="United States", treat(`T' 0 1) mediate(`M') sims(1000) vce(cluster RecordNo)
gen acme_con_eff_us = r(delta1)
gen acme_hi_con_eff_us = r(delta1hi)
gen acme_lo_con_eff_us = r(delta1lo)
gen acme_perc_con_eff_us = r(navg)


local x cond_3 cond_4
local T cond_2
local M trust_send
local Y elec_prom
medeff (regress `M' `T' `x') (logit `Y' `T' `M' `x') if COUNTRY_DATA=="United States", treat(`T' 0 1) mediate(`M') sims(1000) vce(cluster RecordNo)
gen acme_con_tru_us = r(delta1)
gen acme_hi_con_tru_us = r(delta1hi)
gen acme_lo_con_tru_us = r(delta1lo)
gen acme_perc_con_tru_us = r(navg)


* Eng *
local x cond_3 cond_4
local T cond_2
local M send_prior
local Y elec_prom
medeff (regress `M' `T' `x') (logit `Y' `T' `M' `x') if COUNTRY_DATA=="Britain", treat(`T' 0 1) mediate(`M') sims(1000) vce(cluster RecordNo)
gen acme_con_pri_eng = r(delta1)
gen acme_hi_con_pri_eng = r(delta1hi)
gen acme_lo_con_pri_eng = r(delta1lo)
gen acme_perc_con_pri_eng = r(navg)


local x cond_3 cond_4
local T cond_2
local M pol_real
local Y elec_prom
medeff (regress `M' `T' `x') (logit `Y' `T' `M' `x') if COUNTRY_DATA=="Britain", treat(`T' 0 1) mediate(`M') sims(1000) vce(cluster RecordNo)
gen acme_con_rea_eng = r(delta1)
gen acme_hi_con_rea_eng = r(delta1hi)
gen acme_lo_con_rea_eng = r(delta1lo)
gen acme_perc_con_rea_eng = r(navg)
  

local x cond_3 cond_4
local T cond_2
local M nocontr
local Y elec_prom
medeff (regress `M' `T' `x') (logit `Y' `T' `M' `x') if COUNTRY_DATA=="Britain", treat(`T' 0 1) mediate(`M') sims(1000) vce(cluster RecordNo)
gen acme_con_eff_eng = r(delta1)
gen acme_hi_con_eff_eng = r(delta1hi)
gen acme_lo_con_eff_eng = r(delta1lo)
gen acme_perc_con_eff_eng = r(navg)


local x cond_3 cond_4
local T cond_2
local M trust_send
local Y elec_prom
medeff (regress `M' `T' `x') (logit `Y' `T' `M' `x') if COUNTRY_DATA=="Britain", treat(`T' 0 1) mediate(`M') sims(1000) vce(cluster RecordNo)
gen acme_con_tru_eng = r(delta1)
gen acme_hi_con_tru_eng = r(delta1hi)
gen acme_lo_con_tru_eng = r(delta1lo)
gen acme_perc_con_tru_eng = r(navg)

* DK *
local x cond_3 cond_4
local T cond_2
local M send_prior
local Y elec_prom
medeff (regress `M' `T' `x') (logit `Y' `T' `M' `x') if COUNTRY_DATA=="Denmark", treat(`T' 0 1) mediate(`M') sims(1000) vce(cluster RecordNo)
gen acme_con_pri_dk = r(delta1)
gen acme_hi_con_pri_dk = r(delta1hi)
gen acme_lo_con_pri_dk = r(delta1lo)
gen acme_perc_con_pri_dk = r(navg)


local x cond_3 cond_4
local T cond_2
local M pol_real
local Y elec_prom
medeff (regress `M' `T' `x') (logit `Y' `T' `M' `x') if COUNTRY_DATA=="Denmark", treat(`T' 0 1) mediate(`M') sims(1000) vce(cluster RecordNo)
gen acme_con_rea_dk = r(delta1)
gen acme_hi_con_rea_dk = r(delta1hi)
gen acme_lo_con_rea_dk = r(delta1lo)
gen acme_perc_con_rea_dk = r(navg)
  

local x cond_3 cond_4
local T cond_2
local M nocontr
local Y elec_prom
medeff (regress `M' `T' `x') (logit `Y' `T' `M' `x') if COUNTRY_DATA=="Denmark", treat(`T' 0 1) mediate(`M') sims(1000) vce(cluster RecordNo)
gen acme_con_eff_dk = r(delta1)
gen acme_hi_con_eff_dk = r(delta1hi)
gen acme_lo_con_eff_dk = r(delta1lo)
gen acme_perc_con_eff_dk = r(navg)


local x cond_3 cond_4
local T cond_2
local M trust_send
local Y elec_prom
medeff (regress `M' `T' `x') (logit `Y' `T' `M' `x') if COUNTRY_DATA=="Denmark", treat(`T' 0 1) mediate(`M') sims(1000) vce(cluster RecordNo)
gen acme_con_tru_dk = r(delta1)
gen acme_hi_con_tru_dk = r(delta1hi)
gen acme_lo_con_tru_dk = r(delta1lo)
gen acme_perc_con_tru_dk = r(navg)


*** Generate graph variables ***
foreach c in us eng dk {
local m con

gen acme_`m'_all_`c' = .
gen acme_hi_`m'_all_`c' = .
gen acme_lo_`m'_all_`c' = .
gen acme_perc_`m'_all_`c' = .

foreach var in acme_`m' acme_hi_`m' acme_lo_`m' acme_perc_`m' {
replace `var'_all_`c' = `var'_pri_`c' if round ==1  
replace `var'_all_`c' = `var'_tru_`c' if round ==2  
replace `var'_all_`c' = `var'_rea_`c' if round ==3  
replace `var'_all_`c' = `var'_eff_`c' if round ==4  
}

replace acme_perc_`m'_all_`c' = acme_perc_`m'_all_`c'*100
}

*** Generate round variables ***
gen round_graph = round

expand 3

sort COUNTRY_DATA RecordNo round 

by COUNTRY_DATA RecordNo round: gen round_n = _n

order COUNTRY_DATA RecordNo round round_graph round_n

replace round_graph = round -0.2 if round_n==1 
replace round_graph = round +0.2 if round_n==3 

*** Generate graph variables (continued) ***
foreach var in acme_con_all acme_hi_con_all acme_lo_con_all acme_perc_con_all {
gen `var'=.
replace `var' = `var'_us if round_n ==1
replace `var' = `var'_eng if round_n ==2
replace `var' = `var'_dk if round_n ==3
}

save election_prom_pooled_con_graph, replace

*** Graph ***
use election_prom_pooled_con_graph, clear

twoway ///
(rspike acme_hi_con_all acme_lo_con_all round_graph if round_n==1, lcolor(black) lpattern(solid) lwidth(medium)) ///
(rspike acme_hi_con_all acme_lo_con_all round_graph if round_n==2, lcolor(gs6) lpattern(solid) lwidth(medium)) ///
(rspike acme_hi_con_all acme_lo_con_all round_graph if round_n==3, lcolor(gs10) lpattern(solid) lwidth(medium)) ///
(scatter acme_con_all round_graph if round_n==1, mcolor(black) msymbol(circle) msize(small)) ///
(scatter acme_con_all round_graph if round_n==2, mcolor(gs6) msymbol(circle) msize(small)) ///
(scatter acme_con_all round_graph if round_n==3, mcolor(gs10) msymbol(circle) msize(small)) ///
(bar acme_perc_con_all round_graph if round_n==1 & acme_perc_con_all>=0, color(black) lcolor(black) lwidth(none) barw(.08) yaxis(2)) ///
(bar acme_perc_con_all round_graph if round_n==2 & acme_perc_con_all>=0, color(gs6) lcolor(gs6) lwidth(none) barw(.08) yaxis(2)) ///
(bar acme_perc_con_all round_graph if round_n==3 & acme_perc_con_all>=0, color(gs10) lcolor(gs10) lwidth(none) barw(.08) yaxis(2)) ///
, ///
ylabel(-0.1(0.05)0.05, noticks labsize(vsmall) nogrid) ///
ylabel(0(20)100, noticks labsize(vsmall) axis(2)) ///
yscale(range(-0.1 0.05)) ///
xscale(range(0.7 4.3)) ///
plotregion(margin(zero)) ///
yline(0, lcolor(black) lpattern(shortdash) lwidth(thin)) ///
ytitle("ACME") ytitle(, size(small) margin(small)) ///
ytitle("% Mediated",  axis(2)) ytitle(, size(small) margin(small) axis(2)) ///
xtitle("") xtitle(, size(small) margin(vsmall)) ///
xlabel(1 "Priority" 2"Trust" 3 "Control" 4"Efficacy" , labsize(small) noticks) ///
legend(off) ///
graphregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white)) title("If the economy allows it", size(medium) margin(medium) color(black)) xsize(20) ysize(6) 

graph save m_con, replace


* Condition = Majority *

use data_all, clear

* US *
local x cond_2 cond_4
local T cond_3
local M send_prior
local Y elec_prom
medeff (regress `M' `T' `x') (logit `Y' `T' `M' `x') if COUNTRY_DATA=="United States", treat(`T' 0 1) mediate(`M') sims(1000) vce(cluster RecordNo)
gen acme_con_pri_us = r(delta1)
gen acme_hi_con_pri_us = r(delta1hi)
gen acme_lo_con_pri_us = r(delta1lo)
gen acme_perc_con_pri_us = r(navg)


local x cond_2 cond_4
local T cond_3
local M pol_real
local Y elec_prom
medeff (regress `M' `T' `x') (logit `Y' `T' `M' `x') if COUNTRY_DATA=="United States", treat(`T' 0 1) mediate(`M') sims(1000) vce(cluster RecordNo)
gen acme_con_rea_us = r(delta1)
gen acme_hi_con_rea_us = r(delta1hi)
gen acme_lo_con_rea_us = r(delta1lo)
gen acme_perc_con_rea_us = r(navg)
  

local x cond_2 cond_4
local T cond_3
local M nocontr
local Y elec_prom
medeff (regress `M' `T' `x') (logit `Y' `T' `M' `x') if COUNTRY_DATA=="United States", treat(`T' 0 1) mediate(`M') sims(1000) vce(cluster RecordNo)
gen acme_con_eff_us = r(delta1)
gen acme_hi_con_eff_us = r(delta1hi)
gen acme_lo_con_eff_us = r(delta1lo)
gen acme_perc_con_eff_us = r(navg)


local x cond_2 cond_4
local T cond_3
local M trust_send
local Y elec_prom
medeff (regress `M' `T' `x') (logit `Y' `T' `M' `x') if COUNTRY_DATA=="United States", treat(`T' 0 1) mediate(`M') sims(1000) vce(cluster RecordNo)
gen acme_con_tru_us = r(delta1)
gen acme_hi_con_tru_us = r(delta1hi)
gen acme_lo_con_tru_us = r(delta1lo)
gen acme_perc_con_tru_us = r(navg)


* Eng *
local x cond_2 cond_4
local T cond_3
local M send_prior
local Y elec_prom
medeff (regress `M' `T' `x') (logit `Y' `T' `M' `x') if COUNTRY_DATA=="Britain", treat(`T' 0 1) mediate(`M') sims(1000) vce(cluster RecordNo)
gen acme_con_pri_eng = r(delta1)
gen acme_hi_con_pri_eng = r(delta1hi)
gen acme_lo_con_pri_eng = r(delta1lo)
gen acme_perc_con_pri_eng = r(navg)


local x cond_2 cond_4
local T cond_3
local M pol_real
local Y elec_prom
medeff (regress `M' `T' `x') (logit `Y' `T' `M' `x') if COUNTRY_DATA=="Britain", treat(`T' 0 1) mediate(`M') sims(1000) vce(cluster RecordNo)
gen acme_con_rea_eng = r(delta1)
gen acme_hi_con_rea_eng = r(delta1hi)
gen acme_lo_con_rea_eng = r(delta1lo)
gen acme_perc_con_rea_eng = r(navg)
  

local x cond_2 cond_4
local T cond_3
local M nocontr
local Y elec_prom
medeff (regress `M' `T' `x') (logit `Y' `T' `M' `x') if COUNTRY_DATA=="Britain", treat(`T' 0 1) mediate(`M') sims(1000) vce(cluster RecordNo)
gen acme_con_eff_eng = r(delta1)
gen acme_hi_con_eff_eng = r(delta1hi)
gen acme_lo_con_eff_eng = r(delta1lo)
gen acme_perc_con_eff_eng = r(navg)


local x cond_2 cond_4
local T cond_3
local M trust_send
local Y elec_prom
medeff (regress `M' `T' `x') (logit `Y' `T' `M' `x') if COUNTRY_DATA=="Britain", treat(`T' 0 1) mediate(`M') sims(1000) vce(cluster RecordNo)
gen acme_con_tru_eng = r(delta1)
gen acme_hi_con_tru_eng = r(delta1hi)
gen acme_lo_con_tru_eng = r(delta1lo)
gen acme_perc_con_tru_eng = r(navg)

* DK *
local x cond_2 cond_4
local T cond_3
local M send_prior
local Y elec_prom
medeff (regress `M' `T' `x') (logit `Y' `T' `M' `x') if COUNTRY_DATA=="Denmark", treat(`T' 0 1) mediate(`M') sims(1000) vce(cluster RecordNo)
gen acme_con_pri_dk = r(delta1)
gen acme_hi_con_pri_dk = r(delta1hi)
gen acme_lo_con_pri_dk = r(delta1lo)
gen acme_perc_con_pri_dk = r(navg)


local x cond_2 cond_4
local T cond_3
local M pol_real
local Y elec_prom
medeff (regress `M' `T' `x') (logit `Y' `T' `M' `x') if COUNTRY_DATA=="Denmark", treat(`T' 0 1) mediate(`M') sims(1000) vce(cluster RecordNo)
gen acme_con_rea_dk = r(delta1)
gen acme_hi_con_rea_dk = r(delta1hi)
gen acme_lo_con_rea_dk = r(delta1lo)
gen acme_perc_con_rea_dk = r(navg)
  

local x cond_2 cond_4
local T cond_3
local M nocontr
local Y elec_prom
medeff (regress `M' `T' `x') (logit `Y' `T' `M' `x') if COUNTRY_DATA=="Denmark", treat(`T' 0 1) mediate(`M') sims(1000) vce(cluster RecordNo)
gen acme_con_eff_dk = r(delta1)
gen acme_hi_con_eff_dk = r(delta1hi)
gen acme_lo_con_eff_dk = r(delta1lo)
gen acme_perc_con_eff_dk = r(navg)


local x cond_2 cond_4
local T cond_3
local M trust_send
local Y elec_prom
medeff (regress `M' `T' `x') (logit `Y' `T' `M' `x') if COUNTRY_DATA=="Denmark", treat(`T' 0 1) mediate(`M') sims(1000) vce(cluster RecordNo)
gen acme_con_tru_dk = r(delta1)
gen acme_hi_con_tru_dk = r(delta1hi)
gen acme_lo_con_tru_dk = r(delta1lo)
gen acme_perc_con_tru_dk = r(navg)


*** Generate graph variables ***
foreach c in us eng dk {
local m con

gen acme_`m'_all_`c' = .
gen acme_hi_`m'_all_`c' = .
gen acme_lo_`m'_all_`c' = .
gen acme_perc_`m'_all_`c' = .

foreach var in acme_`m' acme_hi_`m' acme_lo_`m' acme_perc_`m' {
replace `var'_all_`c' = `var'_pri_`c' if round ==1  
replace `var'_all_`c' = `var'_tru_`c' if round ==2  
replace `var'_all_`c' = `var'_rea_`c' if round ==3  
replace `var'_all_`c' = `var'_eff_`c' if round ==4  
}

replace acme_perc_`m'_all_`c' = acme_perc_`m'_all_`c'*100
}

*** Generate round variables ***
gen round_graph = round

expand 3

sort COUNTRY_DATA RecordNo round 

by COUNTRY_DATA RecordNo round: gen round_n = _n

order COUNTRY_DATA RecordNo round round_graph round_n

replace round_graph = round -0.2 if round_n==1 
replace round_graph = round +0.2 if round_n==3 

*** Generate graph variables (continued) ***
foreach var in acme_con_all acme_hi_con_all acme_lo_con_all acme_perc_con_all {
gen `var'=.
replace `var' = `var'_us if round_n ==1
replace `var' = `var'_eng if round_n ==2
replace `var' = `var'_dk if round_n ==3
}

save election_prom_pooled_maj_graph, replace

*** Graph ***
use election_prom_pooled_maj_graph, clear

twoway ///
(rspike acme_hi_con_all acme_lo_con_all round_graph if round_n==1, lcolor(black) lpattern(solid) lwidth(medium)) ///
(rspike acme_hi_con_all acme_lo_con_all round_graph if round_n==2, lcolor(gs6) lpattern(solid) lwidth(medium)) ///
(rspike acme_hi_con_all acme_lo_con_all round_graph if round_n==3, lcolor(gs10) lpattern(solid) lwidth(medium)) ///
(scatter acme_con_all round_graph if round_n==1, mcolor(black) msymbol(circle) msize(small)) ///
(scatter acme_con_all round_graph if round_n==2, mcolor(gs6) msymbol(circle) msize(small)) ///
(scatter acme_con_all round_graph if round_n==3, mcolor(gs10) msymbol(circle) msize(small)) ///
(bar acme_perc_con_all round_graph if round_n==1 & acme_perc_con_all>=0, color(black) lcolor(black) lwidth(none) barw(.08) yaxis(2)) ///
(bar acme_perc_con_all round_graph if round_n==2 & acme_perc_con_all>=0, color(gs6) lcolor(gs6) lwidth(none) barw(.08) yaxis(2)) ///
(bar acme_perc_con_all round_graph if round_n==3 & acme_perc_con_all>=0, color(gs10) lcolor(gs10) lwidth(none) barw(.08) yaxis(2)) ///
, ///
ylabel(-0.1(0.05)0.05, noticks labsize(vsmall) nogrid) ///
ylabel(0(20)100, noticks labsize(vsmall) axis(2)) ///
yscale(range(-0.1 0.05)) ///
xscale(range(0.7 4.3)) ///
plotregion(margin(zero)) ///
yline(0, lcolor(black) lpattern(shortdash) lwidth(thin)) ///
ytitle("ACME") ytitle(, size(small) margin(small)) ///
ytitle("% Mediated",  axis(2)) ytitle(, size(small) margin(small) axis(2)) ///
xtitle("") xtitle(, size(small) margin(vsmall)) ///
xlabel(1 "Priority" 2"Trust" 3 "Control" 4"Efficacy" , labsize(small) noticks) ///
legend(off) ///
graphregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white)) title("If a majority is in favor", size(medium) margin(medium) color(black)) xsize(20) ysize(6) 

graph save m_maj, replace


* Condition = Opportunity *

use data_all, clear

* US *
local x cond_2 cond_3
local T cond_4
local M send_prior
local Y elec_prom
medeff (regress `M' `T' `x') (logit `Y' `T' `M' `x') if COUNTRY_DATA=="United States", treat(`T' 0 1) mediate(`M') sims(1000) vce(cluster RecordNo)
gen acme_con_pri_us = r(delta1)
gen acme_hi_con_pri_us = r(delta1hi)
gen acme_lo_con_pri_us = r(delta1lo)
gen acme_perc_con_pri_us = r(navg)


local x cond_2 cond_3
local T cond_4
local M pol_real
local Y elec_prom
medeff (regress `M' `T' `x') (logit `Y' `T' `M' `x') if COUNTRY_DATA=="United States", treat(`T' 0 1) mediate(`M') sims(1000) vce(cluster RecordNo)
gen acme_con_rea_us = r(delta1)
gen acme_hi_con_rea_us = r(delta1hi)
gen acme_lo_con_rea_us = r(delta1lo)
gen acme_perc_con_rea_us = r(navg)
  

local x cond_2 cond_3
local T cond_4
local M nocontr
local Y elec_prom
medeff (regress `M' `T' `x') (logit `Y' `T' `M' `x') if COUNTRY_DATA=="United States", treat(`T' 0 1) mediate(`M') sims(1000) vce(cluster RecordNo)
gen acme_con_eff_us = r(delta1)
gen acme_hi_con_eff_us = r(delta1hi)
gen acme_lo_con_eff_us = r(delta1lo)
gen acme_perc_con_eff_us = r(navg)


local x cond_2 cond_3
local T cond_4
local M trust_send
local Y elec_prom
medeff (regress `M' `T' `x') (logit `Y' `T' `M' `x') if COUNTRY_DATA=="United States", treat(`T' 0 1) mediate(`M') sims(1000) vce(cluster RecordNo)
gen acme_con_tru_us = r(delta1)
gen acme_hi_con_tru_us = r(delta1hi)
gen acme_lo_con_tru_us = r(delta1lo)
gen acme_perc_con_tru_us = r(navg)


* Eng *
local x cond_2 cond_3
local T cond_4
local M send_prior
local Y elec_prom
medeff (regress `M' `T' `x') (logit `Y' `T' `M' `x') if COUNTRY_DATA=="Britain", treat(`T' 0 1) mediate(`M') sims(1000) vce(cluster RecordNo)
gen acme_con_pri_eng = r(delta1)
gen acme_hi_con_pri_eng = r(delta1hi)
gen acme_lo_con_pri_eng = r(delta1lo)
gen acme_perc_con_pri_eng = r(navg)


local x cond_2 cond_3
local T cond_4
local M pol_real
local Y elec_prom
medeff (regress `M' `T' `x') (logit `Y' `T' `M' `x') if COUNTRY_DATA=="Britain", treat(`T' 0 1) mediate(`M') sims(1000) vce(cluster RecordNo)
gen acme_con_rea_eng = r(delta1)
gen acme_hi_con_rea_eng = r(delta1hi)
gen acme_lo_con_rea_eng = r(delta1lo)
gen acme_perc_con_rea_eng = r(navg)
  

local x cond_2 cond_3
local T cond_4
local M nocontr
local Y elec_prom
medeff (regress `M' `T' `x') (logit `Y' `T' `M' `x') if COUNTRY_DATA=="Britain", treat(`T' 0 1) mediate(`M') sims(1000) vce(cluster RecordNo)
gen acme_con_eff_eng = r(delta1)
gen acme_hi_con_eff_eng = r(delta1hi)
gen acme_lo_con_eff_eng = r(delta1lo)
gen acme_perc_con_eff_eng = r(navg)


local x cond_2 cond_3
local T cond_4
local M trust_send
local Y elec_prom
medeff (regress `M' `T' `x') (logit `Y' `T' `M' `x') if COUNTRY_DATA=="Britain", treat(`T' 0 1) mediate(`M') sims(1000) vce(cluster RecordNo)
gen acme_con_tru_eng = r(delta1)
gen acme_hi_con_tru_eng = r(delta1hi)
gen acme_lo_con_tru_eng = r(delta1lo)
gen acme_perc_con_tru_eng = r(navg)

* DK *
local x cond_2 cond_3
local T cond_4
local M send_prior
local Y elec_prom
medeff (regress `M' `T' `x') (logit `Y' `T' `M' `x') if COUNTRY_DATA=="Denmark", treat(`T' 0 1) mediate(`M') sims(1000) vce(cluster RecordNo)
gen acme_con_pri_dk = r(delta1)
gen acme_hi_con_pri_dk = r(delta1hi)
gen acme_lo_con_pri_dk = r(delta1lo)
gen acme_perc_con_pri_dk = r(navg)


local x cond_2 cond_3
local T cond_4
local M pol_real
local Y elec_prom
medeff (regress `M' `T' `x') (logit `Y' `T' `M' `x') if COUNTRY_DATA=="Denmark", treat(`T' 0 1) mediate(`M') sims(1000) vce(cluster RecordNo)
gen acme_con_rea_dk = r(delta1)
gen acme_hi_con_rea_dk = r(delta1hi)
gen acme_lo_con_rea_dk = r(delta1lo)
gen acme_perc_con_rea_dk = r(navg)
  

local x cond_2 cond_3
local T cond_4
local M nocontr
local Y elec_prom
medeff (regress `M' `T' `x') (logit `Y' `T' `M' `x') if COUNTRY_DATA=="Denmark", treat(`T' 0 1) mediate(`M') sims(1000) vce(cluster RecordNo)
gen acme_con_eff_dk = r(delta1)
gen acme_hi_con_eff_dk = r(delta1hi)
gen acme_lo_con_eff_dk = r(delta1lo)
gen acme_perc_con_eff_dk = r(navg)


local x cond_2 cond_3
local T cond_4
local M trust_send
local Y elec_prom
medeff (regress `M' `T' `x') (logit `Y' `T' `M' `x') if COUNTRY_DATA=="Denmark", treat(`T' 0 1) mediate(`M') sims(1000) vce(cluster RecordNo)
gen acme_con_tru_dk = r(delta1)
gen acme_hi_con_tru_dk = r(delta1hi)
gen acme_lo_con_tru_dk = r(delta1lo)
gen acme_perc_con_tru_dk = r(navg)


*** Generate graph variables ***
foreach c in us eng dk {
local m con

gen acme_`m'_all_`c' = .
gen acme_hi_`m'_all_`c' = .
gen acme_lo_`m'_all_`c' = .
gen acme_perc_`m'_all_`c' = .

foreach var in acme_`m' acme_hi_`m' acme_lo_`m' acme_perc_`m' {
replace `var'_all_`c' = `var'_pri_`c' if round ==1  
replace `var'_all_`c' = `var'_tru_`c' if round ==2  
replace `var'_all_`c' = `var'_rea_`c' if round ==3  
replace `var'_all_`c' = `var'_eff_`c' if round ==4  
}

replace acme_perc_`m'_all_`c' = acme_perc_`m'_all_`c'*100
}

*** Generate round variables ***
gen round_graph = round

expand 3

sort COUNTRY_DATA RecordNo round 

by COUNTRY_DATA RecordNo round: gen round_n = _n

order COUNTRY_DATA RecordNo round round_graph round_n

replace round_graph = round -0.2 if round_n==1 
replace round_graph = round +0.2 if round_n==3 

*** Generate graph variables (continued) ***
foreach var in acme_con_all acme_hi_con_all acme_lo_con_all acme_perc_con_all {
gen `var'=.
replace `var' = `var'_us if round_n ==1
replace `var' = `var'_eng if round_n ==2
replace `var' = `var'_dk if round_n ==3
}

save election_prom_pooled_opp_graph, replace

*** Graph ***
use election_prom_pooled_opp_graph, clear

twoway ///
(rspike acme_hi_con_all acme_lo_con_all round_graph if round_n==1, lcolor(black) lpattern(solid) lwidth(medium)) ///
(rspike acme_hi_con_all acme_lo_con_all round_graph if round_n==2, lcolor(gs6) lpattern(solid) lwidth(medium)) ///
(rspike acme_hi_con_all acme_lo_con_all round_graph if round_n==3, lcolor(gs10) lpattern(solid) lwidth(medium)) ///
(scatter acme_con_all round_graph if round_n==1, mcolor(black) msymbol(circle) msize(small)) ///
(scatter acme_con_all round_graph if round_n==2, mcolor(gs6) msymbol(circle) msize(small)) ///
(scatter acme_con_all round_graph if round_n==3, mcolor(gs10) msymbol(circle) msize(small)) ///
(bar acme_perc_con_all round_graph if round_n==1 & acme_perc_con_all>=0, color(black) lcolor(black) lwidth(none) barw(.08) yaxis(2)) ///
(bar acme_perc_con_all round_graph if round_n==2 & acme_perc_con_all>=0, color(gs6) lcolor(gs6) lwidth(none) barw(.08) yaxis(2)) ///
(bar acme_perc_con_all round_graph if round_n==3 & acme_perc_con_all>=0, color(gs10) lcolor(gs10) lwidth(none) barw(.08) yaxis(2)) ///
, ///
ylabel(-0.1(0.05)0.05, noticks labsize(vsmall) nogrid) ///
ylabel(0(20)100, noticks labsize(vsmall) axis(2)) ///
yscale(range(-0.1 0.05)) ///
xscale(range(0.7 4.3)) ///
plotregion(margin(zero)) ///
yline(0, lcolor(black) lpattern(shortdash) lwidth(thin)) ///
ytitle("ACME") ytitle(, size(small) margin(small)) ///
ytitle("% Mediated",  axis(2)) ytitle(, size(small) margin(small) axis(2)) ///
xtitle("") xtitle(, size(small) margin(vsmall)) ///
xlabel(1 "Priority" 2"Trust" 3 "Control" 4"Efficacy" , labsize(small) noticks) ///
legend(off) ///
graphregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white)) title("If the opportunity arises", size(medium) margin(medium) color(black)) xsize(20) ysize(6) 

graph save m_opp, replace


******************************** Output/outcome ********************************
cls

use data_all, clear


local x 
local T output
local M send_prior
local Y elec_prom
medeff (regress `M' `T' `x') (logit `Y' `T' `M' `x') if COUNTRY_DATA=="United States", treat(`T' 0 1) mediate(`M') sims(1000) vce(cluster RecordNo)
gen acme_out_pri_us = r(delta1)
gen acme_hi_out_pri_us = r(delta1hi)
gen acme_lo_out_pri_us = r(delta1lo)
gen acme_perc_out_pri_us = r(navg)

local x 
local T output
local M pol_real
local Y elec_prom
medeff (regress `M' `T' `x') (logit `Y' `T' `M' `x') if COUNTRY_DATA=="United States", treat(`T' 0 1) mediate(`M') sims(1000) vce(cluster RecordNo)
gen acme_out_rea_us = r(delta1)
gen acme_hi_out_rea_us = r(delta1hi)
gen acme_lo_out_rea_us = r(delta1lo)
gen acme_perc_out_rea_us = r(navg)
 
local x 
local T output
local M nocontr
local Y elec_prom
medeff (regress `M' `T' `x') (logit `Y' `T' `M' `x') if COUNTRY_DATA=="United States", treat(`T' 0 1) mediate(`M') sims(1000) vce(cluster RecordNo)
gen acme_out_eff_us = r(delta1)
gen acme_hi_out_eff_us = r(delta1hi)
gen acme_lo_out_eff_us = r(delta1lo)
gen acme_perc_out_eff_us = r(navg)

local x 
local T output
local M trust_send
local Y elec_prom
medeff (regress `M' `T' `x') (logit `Y' `T' `M' `x') if COUNTRY_DATA=="United States", treat(`T' 0 1) mediate(`M') sims(1000) vce(cluster RecordNo)
gen acme_out_tru_us = r(delta1)
gen acme_hi_out_tru_us = r(delta1hi)
gen acme_lo_out_tru_us = r(delta1lo)
gen acme_perc_out_tru_us = r(navg)


local x 
local T output
local M send_prior
local Y elec_prom
medeff (regress `M' `T' `x') (logit `Y' `T' `M' `x') if COUNTRY_DATA=="Britain", treat(`T' 0 1) mediate(`M') sims(1000) vce(cluster RecordNo)
gen acme_out_pri_eng = r(delta1)
gen acme_hi_out_pri_eng = r(delta1hi)
gen acme_lo_out_pri_eng = r(delta1lo)
gen acme_perc_out_pri_eng = r(navg)


local x 
local T output
local M pol_real
local Y elec_prom
medeff (regress `M' `T' `x') (logit `Y' `T' `M' `x') if COUNTRY_DATA=="Britain", treat(`T' 0 1) mediate(`M') sims(1000) vce(cluster RecordNo)
gen acme_out_rea_eng = r(delta1)
gen acme_hi_out_rea_eng = r(delta1hi)
gen acme_lo_out_rea_eng = r(delta1lo)
gen acme_perc_out_rea_eng = r(navg)
  

local x 
local T output
local M nocontr
local Y elec_prom
medeff (regress `M' `T' `x') (logit `Y' `T' `M' `x') if COUNTRY_DATA=="Britain", treat(`T' 0 1) mediate(`M') sims(1000) vce(cluster RecordNo)
gen acme_out_eff_eng = r(delta1)
gen acme_hi_out_eff_eng = r(delta1hi)
gen acme_lo_out_eff_eng = r(delta1lo)
gen acme_perc_out_eff_eng = r(navg)

local x 
local T output
local M trust_send
local Y elec_prom
medeff (regress `M' `T' `x') (logit `Y' `T' `M' `x') if COUNTRY_DATA=="Britain", treat(`T' 0 1) mediate(`M') sims(1000) vce(cluster RecordNo)
gen acme_out_tru_eng = r(delta1)
gen acme_hi_out_tru_eng = r(delta1hi)
gen acme_lo_out_tru_eng = r(delta1lo)
gen acme_perc_out_tru_eng = r(navg)


local x 
local T output
local M send_prior
local Y elec_prom
medeff (regress `M' `T' `x') (logit `Y' `T' `M' `x') if COUNTRY_DATA=="Denmark", treat(`T' 0 1) mediate(`M') sims(1000) vce(cluster RecordNo)
gen acme_out_pri_dk = r(delta1)
gen acme_hi_out_pri_dk = r(delta1hi)
gen acme_lo_out_pri_dk = r(delta1lo)
gen acme_perc_out_pri_dk = r(navg)


local x 
local T output
local M pol_real
local Y elec_prom
medeff (regress `M' `T' `x') (logit `Y' `T' `M' `x') if COUNTRY_DATA=="Denmark", treat(`T' 0 1) mediate(`M') sims(1000) vce(cluster RecordNo)
gen acme_out_rea_dk = r(delta1)
gen acme_hi_out_rea_dk = r(delta1hi)
gen acme_lo_out_rea_dk = r(delta1lo)
gen acme_perc_out_rea_dk = r(navg)
  

local x 
local T output
local M nocontr
local Y elec_prom
medeff (regress `M' `T' `x') (logit `Y' `T' `M' `x') if COUNTRY_DATA=="Denmark", treat(`T' 0 1) mediate(`M') sims(1000) vce(cluster RecordNo)
gen acme_out_eff_dk = r(delta1)
gen acme_hi_out_eff_dk = r(delta1hi)
gen acme_lo_out_eff_dk = r(delta1lo)
gen acme_perc_out_eff_dk = r(navg)


local x 
local T output
local M trust_send
local Y elec_prom
medeff (regress `M' `T' `x') (logit `Y' `T' `M' `x') if COUNTRY_DATA=="Denmark", treat(`T' 0 1) mediate(`M') sims(1000) vce(cluster RecordNo)
gen acme_out_tru_dk = r(delta1)
gen acme_hi_out_tru_dk = r(delta1hi)
gen acme_lo_out_tru_dk = r(delta1lo)
gen acme_perc_out_tru_dk = r(navg)


*** Generate graph variables ***
foreach c in us eng dk {
local m out

gen acme_`m'_all_`c' = .
gen acme_hi_`m'_all_`c' = .
gen acme_lo_`m'_all_`c' = .
gen acme_perc_`m'_all_`c' = .

foreach var in acme_`m' acme_hi_`m' acme_lo_`m' acme_perc_`m' {
replace `var'_all_`c' = `var'_pri_`c' if round ==1  
replace `var'_all_`c' = `var'_tru_`c' if round ==2  
replace `var'_all_`c' = `var'_rea_`c' if round ==3  
replace `var'_all_`c' = `var'_eff_`c' if round ==4  
}

replace acme_perc_`m'_all_`c' = acme_perc_`m'_all_`c'*100
}

*** Generate round variables ***
gen round_graph = round

expand 3

sort COUNTRY_DATA RecordNo round 

by COUNTRY_DATA RecordNo round: gen round_n = _n

order COUNTRY_DATA RecordNo round round_graph round_n

replace round_graph = round -0.2 if round_n==1 
replace round_graph = round +0.2 if round_n==3 


*** Generate graph variables (continued) ***
foreach var in acme_out_all acme_hi_out_all acme_lo_out_all acme_perc_out_all {
gen `var'=.
replace `var' = `var'_us if round_n ==1
replace `var' = `var'_eng if round_n ==2
replace `var' = `var'_dk if round_n ==3
}

save election_prom_pooled_out_graph, replace


*** Graph ***
use election_prom_pooled_out_graph, clear

twoway ///
(rspike acme_hi_out_all acme_lo_out_all round_graph if round_n==1, lcolor(black) lpattern(solid) lwidth(medium)) ///
(rspike acme_hi_out_all acme_lo_out_all round_graph if round_n==2, lcolor(gs6) lpattern(solid) lwidth(medium)) ///
(rspike acme_hi_out_all acme_lo_out_all round_graph if round_n==3, lcolor(gs10) lpattern(solid) lwidth(medium)) ///
(scatter acme_out_all round_graph if round_n==1, mcolor(black) msymbol(circle) msize(small)) ///
(scatter acme_out_all round_graph if round_n==2, mcolor(gs6) msymbol(circle) msize(small)) ///
(scatter acme_out_all round_graph if round_n==3, mcolor(gs10) msymbol(circle) msize(small)) ///
(bar acme_perc_out_all round_graph if round_n==1 & acme_perc_out_all>=0, color(black) lcolor(black) lwidth(none) barw(.08) yaxis(2)) ///
(bar acme_perc_out_all round_graph if round_n==2 & acme_perc_out_all>=0, color(gs6) lcolor(gs6) lwidth(none) barw(.08) yaxis(2)) ///
(bar acme_perc_out_all round_graph if round_n==3 & acme_perc_out_all>=0, color(gs10) lcolor(gs10) lwidth(none) barw(.08) yaxis(2)) ///
, ///
ylabel(-0.1(0.05)0.05, noticks labsize(vsmall) nogrid) ///
ylabel(0(20)100, noticks labsize(vsmall) axis(2)) ///
yscale(range(-0.1 0.05)) ///
xscale(range(0.7 4.3)) ///
plotregion(margin(zero)) ///
yline(0, lcolor(black) lpattern(shortdash) lwidth(thin)) ///
ytitle("ACME") ytitle(, size(small) margin(small)) ///
ytitle("% Mediated",  axis(2)) ytitle(, size(small) margin(small) axis(2)) ///
xtitle("") xtitle(, size(small) margin(vsmall)) ///
xlabel(1 "Priority" 2"Trust" 3 "Control" 4"Efficacy" , labsize(small) noticks) ///
legend(off) ///
graphregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white)) title("Output/outcome", size(medium) margin(medium) color(black)) xsize(20) ysize(6)
graph save m_out, replace


*** all graphs ***
graph combine m_con.gph m_maj.gph m_opp.gph m_out.gph, xsize(14) ysize(20) graphregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white) margin(tiny)) rows(4) cols(1) 

graph export Figure_2.png, width(3000) replace





*******************************************************************************
******************************* Figure 3 ***************************************
********************************************************************************

cls
use data_us, clear
reg pol_acc vote_sender, cluster(RecordNo)
estimates store send_us

reg pol_acc i.promise, cluster(RecordNo)
estimates store prom_us

reg pol_acc i.spec, cluster(RecordNo)
estimates store spec_us

reg pol_acc output, cluster(RecordNo)
estimates store out_us

reg pol_acc ib2.time, cluster(RecordNo)
estimates store time_us

reg pol_acc i.cond, cluster(RecordNo)
estimates store cond_us


use data_uk, clear
reg pol_acc vote_sender, cluster(RecordNo)
estimates store send_en

reg pol_acc i.promise, cluster(RecordNo)
estimates store prom_en

reg pol_acc i.spec, cluster(RecordNo)
estimates store spec_en

reg pol_acc output, cluster(RecordNo)
estimates store out_en

reg pol_acc ib2.time, cluster(RecordNo)
estimates store time_en

reg pol_acc i.cond, cluster(RecordNo)
estimates store cond_en


use data_dk, clear
reg pol_acc vote_sender, cluster(RecordNo)
estimates store send_dk

reg pol_acc i.promise, cluster(RecordNo)
estimates store prom_dk

reg pol_acc i.spec, cluster(RecordNo)
estimates store spec_dk

reg pol_acc output, cluster(RecordNo)
estimates store out_dk

reg pol_acc ib2.time, cluster(RecordNo)
estimates store time_dk

reg pol_acc i.cond, cluster(RecordNo)
estimates store cond_dk


coefplot (send_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(prom_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(spec_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(out_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(time_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(cond_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(send_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(prom_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(spec_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(out_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(time_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(cond_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(send_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(prom_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(spec_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(out_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(time_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(cond_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))), ///
drop(_cons) yscale(noline alt) grid(glcolor(gs6) glwidth(vthin)) ///
headings(vote_sender = "{bf:Sender}" 1.promise = "{bf:Committing statement}" 1.spec = "{bf:Numeric goal}" 1.time = "{bf:Time horizon}" output = "{bf:Output/outcome}" 1.cond = "{bf:Conditionality}", labgap(-93) nogap labsize(vsmall)) ///
xline(0, lcolor(black) lpattern(shortdash)) ytitle("", size(small)) levels(95) ///
graphregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white) margin(l=30)) coeflabels(, notick labgap(-90)) ///
xsize(14) ysize(20) xlabel(-0.30(0.05)0.2, labsize(vsmall)) ylabel(, labsize(vsmall)) baselevels legend(off) msymbol(o) 


graph export acc_results_figure.png, width(3000) replace



********************************************************************************
********************************************************************************
**************************** ONLINE APPENDIX ***********************************
********************************************************************************
********************************************************************************


********************************************************************************
******************* Appendix D1: Table of main results *************************
********************************************************************************

* Sender *
cls
eststo clear

use data_us, clear
reg elec_prom i.vote_sender, cluster(RecordNo)
eststo

use data_uk, clear
reg elec_prom i.vote_sender, cluster(RecordNo)
eststo

use data_dk, clear

reg elec_prom i.vote_sender, cluster(RecordNo)
eststo

* Statement *
use data_us, clear
reg elec_prom i.promise, cluster(RecordNo)
eststo

use data_uk, clear
reg elec_prom i.promise, cluster(RecordNo)
eststo

use data_dk, clear

reg elec_prom i.promise, cluster(RecordNo)
eststo

* Specificity *
use data_us, clear
reg elec_prom i.spec, cluster(RecordNo)
eststo

use data_uk, clear
reg elec_prom i.spec, cluster(RecordNo)
eststo

use data_dk, clear

reg elec_prom i.spec, cluster(RecordNo)
eststo

* Output/outcome *
use data_us, clear
reg elec_prom output, cluster(RecordNo)
eststo

use data_uk, clear
reg elec_prom output, cluster(RecordNo)
eststo

use data_dk, clear

reg elec_prom output, cluster(RecordNo)
eststo


* Time horizon *
use data_us, clear
reg elec_prom ib2.time, cluster(RecordNo)
eststo

use data_uk, clear
reg elec_prom ib2.time, cluster(RecordNo)
eststo

use data_dk, clear

reg elec_prom ib2.time, cluster(RecordNo)
eststo

* Conditionality *
use data_us, clear
reg elec_prom i.cond, cluster(RecordNo)
eststo

use data_uk, clear
reg elec_prom i.cond, cluster(RecordNo)
eststo

use data_dk, clear

reg elec_prom i.cond, cluster(RecordNo)
eststo

*Please decrease the font size in order to see the whole table*
esttab, replace label b(3) se(3) se star(* 0.05) drop() eqlabels(none) nonumbers compress



********************************************************************************
**************** Appendix D2: All attributes in same model *********************
********************************************************************************


* Table *
cls
eststo clear

use data_us, clear
reg elec_prom i.timing i.vote_sender i.promise i.spec output ib2.time i.cond, cluster(RecordNo)
eststo

use data_uk, clear
reg elec_prom i.timing i.vote_sender i.promise i.spec output ib2.time i.cond, cluster(RecordNo)
eststo

use data_dk, clear
reg elec_prom i.timing i.vote_sender i.promise i.spec output ib2.time i.cond, cluster(RecordNo)
eststo

esttab, replace label b(3) se(3) se star(+ 0.1 * 0.05 ** 0.01 *** 0.001) drop() eqlabels(none) nonumbers compress
esttab using app_all_same.rtf, replace label b(3) se(3) se star(+ 0.1 * 0.05 ** 0.01 *** 0.001) drop() eqlabels(none) nonumbers compress



* Figure *
use data_us, clear
reg elec_prom i.timing vote_sender i.promise i.spec output ib2.time i.cond, cluster(RecordNo)
estimates store all_us


use data_uk, clear
reg elec_prom i.timing vote_sender i.promise i.spec output ib2.time i.cond, cluster(RecordNo)
estimates store all_eng


use data_dk, clear
reg elec_prom i.timing vote_sender i.promise i.spec output ib2.time i.cond, cluster(RecordNo)
estimates store all_dk

coefplot (all_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(all_eng, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(all_dk, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))), ///
drop(_cons) yscale(noline alt) grid(glcolor(gs6) glwidth(vthin)) ///
headings(1.timing = "{bf:Timing}" vote_sender = "{bf:Sender}" 1.promise = "{bf:Committing statement}" 1.spec = "{bf:Numeric goal}" 1.time = "{bf:Time horizon}" output = "{bf:Output/outcome}" 1.cond = "{bf:Conditionality}", labgap(-93) nogap labsize(vsmall)) ///
xline(0, lcolor(black) lpattern(shortdash)) ytitle("", size(small)) levels(95) ///
graphregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white) margin(l=30)) coeflabels(, notick labgap(-90)) ///
xsize(14) ysize(20) xlabel(-0.25(0.05)0.2, labsize(vsmall)) ylabel(, labsize(vsmall)) baselevels legend(off) msymbol(o) 


graph export app_d2.png, width(1000) replace





********************************************************************************
*********** Appendix D3: Alternative specifications of main analysis ***********
********************************************************************************


********************************* Logit models *********************************
cls
use data_us, clear
logit elec_prom i.timing, cluster(RecordNo)
estimates store timi_us

logit elec_prom vote_sender, cluster(RecordNo)
estimates store send_us

logit elec_prom i.promise, cluster(RecordNo)
estimates store prom_us

logit elec_prom i.spec, cluster(RecordNo)
estimates store spec_us

logit elec_prom output, cluster(RecordNo)
estimates store out_us

logit elec_prom ib2.time, cluster(RecordNo)
estimates store time_us

logit elec_prom i.cond, cluster(RecordNo)
estimates store cond_us


use data_uk, clear
logit elec_prom i.timing, cluster(RecordNo)
estimates store timi_en

logit elec_prom vote_sender, cluster(RecordNo)
estimates store send_en

logit elec_prom i.promise, cluster(RecordNo)
estimates store prom_en

logit elec_prom i.spec, cluster(RecordNo)
estimates store spec_en

logit elec_prom output, cluster(RecordNo)
estimates store out_en

logit elec_prom ib2.time, cluster(RecordNo)
estimates store time_en

logit elec_prom i.cond, cluster(RecordNo)
estimates store cond_en


use data_dk, clear

logit elec_prom i.timing, cluster(RecordNo)
estimates store timi_dk

logit elec_prom vote_sender, cluster(RecordNo)
estimates store send_dk

logit elec_prom i.promise, cluster(RecordNo)
estimates store prom_dk

logit elec_prom i.spec, cluster(RecordNo)
estimates store spec_dk

logit elec_prom output, cluster(RecordNo)
estimates store out_dk

logit elec_prom ib2.time, cluster(RecordNo)
estimates store time_dk

logit elec_prom i.cond, cluster(RecordNo)
estimates store cond_dk


coefplot (timi_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(send_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(prom_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(spec_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(out_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(time_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(cond_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(timi_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(send_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(prom_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(spec_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(out_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(time_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(cond_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(timi_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(send_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(prom_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(spec_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(out_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(time_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(cond_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))), ///
drop(_cons) yscale(noline alt) grid(glcolor(gs6) glwidth(vthin)) ///
headings(1.timing = "{bf:Timing}" vote_sender = "{bf:Sender}" 1.promise = "{bf:Committing statement}" 1.spec = "{bf:Numeric goal}" 1.time = "{bf:Time horizon}" output = "{bf:Output/outcome}" 1.cond = "{bf:Conditionality}", labgap(-93) nogap labsize(vsmall)) ///
xline(0, lcolor(black) lpattern(shortdash)) ytitle("", size(small)) levels(95) ///
graphregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white) margin(l=30)) coeflabels(, notick labgap(-90)) ///
xsize(14) ysize(20) xlabel(-1.0(0.1)0.5, labsize(vsmall)) ylabel(, labsize(vsmall)) baselevels legend(off) msymbol(o) 


graph export app_d3a.png, width(1000) replace



******************************* Random effects *********************************
cls
use data_us, clear
xtset RecordNo round

xtreg elec_prom i.timing, cluster(RecordNo) re
estimates store timi_us

xtreg elec_prom vote_sender, cluster(RecordNo) re
estimates store send_us

xtreg elec_prom i.promise, cluster(RecordNo) re
estimates store prom_us

xtreg elec_prom i.spec, cluster(RecordNo) re
estimates store spec_us

xtreg elec_prom output, cluster(RecordNo) re
estimates store out_us

xtreg elec_prom ib2.time, cluster(RecordNo) re
estimates store time_us

xtreg elec_prom i.cond, cluster(RecordNo) re
estimates store cond_us


use data_uk, clear
xtset RecordNo round

xtreg elec_prom i.timing, cluster(RecordNo) re
estimates store timi_en

xtreg elec_prom vote_sender, cluster(RecordNo) re
estimates store send_en

xtreg elec_prom i.promise, cluster(RecordNo) re
estimates store prom_en

xtreg elec_prom i.spec, cluster(RecordNo) re
estimates store spec_en

xtreg elec_prom output, cluster(RecordNo) re
estimates store out_en

xtreg elec_prom ib2.time, cluster(RecordNo) re
estimates store time_en

xtreg elec_prom i.cond, cluster(RecordNo) re
estimates store cond_en


use data_dk, clear
xtset RecordNo round

xtreg elec_prom i.timing, cluster(RecordNo) re
estimates store timi_dk

xtreg elec_prom vote_sender, cluster(RecordNo) re
estimates store send_dk

xtreg elec_prom i.promise, cluster(RecordNo) re
estimates store prom_dk

xtreg elec_prom i.spec, cluster(RecordNo) re
estimates store spec_dk

xtreg elec_prom output, cluster(RecordNo) re
estimates store out_dk

xtreg elec_prom ib2.time, cluster(RecordNo) re
estimates store time_dk

xtreg elec_prom i.cond, cluster(RecordNo) re
estimates store cond_dk


coefplot (timi_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(send_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(prom_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(spec_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(out_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(time_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(cond_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(timi_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(send_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(prom_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(spec_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(out_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(time_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(cond_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(timi_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(send_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(prom_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(spec_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(out_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(time_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(cond_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))), ///
drop(_cons) yscale(noline alt) grid(glcolor(gs6) glwidth(vthin)) ///
headings(1.timing = "{bf:Timing}" vote_sender = "{bf:Sender}" 1.promise = "{bf:Committing statement}" 1.spec = "{bf:Numeric goal}" 1.time = "{bf:Time horizon}" output = "{bf:Output/outcome}" 1.cond = "{bf:Conditionality}", labgap(-93) nogap labsize(vsmall)) ///
xline(0, lcolor(black) lpattern(shortdash)) ytitle("", size(small)) levels(95) ///
graphregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white) margin(l=30)) coeflabels(, notick labgap(-90)) ///
xsize(14) ysize(20) xlabel(-0.25(0.05)0.2, labsize(vsmall)) ylabel(, labsize(vsmall)) baselevels legend(off) msymbol(o) 


graph export app_d3b.png, width(1000) replace



******************************* Fixed effects *********************************
cls
use data_us, clear
xtset RecordNo round

xtreg elec_prom i.timing, cluster(RecordNo) fe
estimates store timi_us

xtreg elec_prom vote_sender, cluster(RecordNo) fe
estimates store send_us

xtreg elec_prom i.promise, cluster(RecordNo) fe
estimates store prom_us

xtreg elec_prom i.spec, cluster(RecordNo) fe
estimates store spec_us

xtreg elec_prom output, cluster(RecordNo) fe
estimates store out_us

xtreg elec_prom ib2.time, cluster(RecordNo) fe
estimates store time_us

xtreg elec_prom i.cond, cluster(RecordNo) fe
estimates store cond_us


use data_uk, clear
xtset RecordNo round

xtreg elec_prom i.timing, cluster(RecordNo) fe
estimates store timi_en

xtreg elec_prom vote_sender, cluster(RecordNo) fe
estimates store send_en

xtreg elec_prom i.promise, cluster(RecordNo) fe
estimates store prom_en

xtreg elec_prom i.spec, cluster(RecordNo) fe
estimates store spec_en

xtreg elec_prom output, cluster(RecordNo) fe
estimates store out_en

xtreg elec_prom ib2.time, cluster(RecordNo) fe
estimates store time_en

xtreg elec_prom i.cond, cluster(RecordNo) fe
estimates store cond_en


use data_dk, clear
xtset RecordNo round

xtreg elec_prom i.timing, cluster(RecordNo) fe
estimates store timi_dk

xtreg elec_prom vote_sender, cluster(RecordNo) fe
estimates store send_dk

xtreg elec_prom i.promise, cluster(RecordNo) fe
estimates store prom_dk

xtreg elec_prom i.spec, cluster(RecordNo) fe
estimates store spec_dk

xtreg elec_prom output, cluster(RecordNo) fe
estimates store out_dk

xtreg elec_prom ib2.time, cluster(RecordNo) fe
estimates store time_dk

xtreg elec_prom i.cond, cluster(RecordNo) fe
estimates store cond_dk


coefplot (timi_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(send_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(prom_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(spec_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(out_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(time_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(cond_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(timi_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(send_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(prom_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(spec_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(out_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(time_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(cond_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(timi_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(send_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(prom_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(spec_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(out_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(time_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(cond_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))), ///
drop(_cons) yscale(noline alt) grid(glcolor(gs6) glwidth(vthin)) ///
headings(1.timing = "{bf:Timing}" vote_sender = "{bf:Sender}" 1.promise = "{bf:Committing statement}" 1.spec = "{bf:Numeric goal}" 1.time = "{bf:Time horizon}" output = "{bf:Output/outcome}" 1.cond = "{bf:Conditionality}", labgap(-93) nogap labsize(vsmall)) ///
xline(0, lcolor(black) lpattern(shortdash)) ytitle("", size(small)) levels(95) ///
graphregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white) margin(l=30)) coeflabels(, notick labgap(-90)) ///
xsize(14) ysize(20) xlabel(-0.25(0.05)0.2, labsize(vsmall)) ylabel(, labsize(vsmall)) baselevels legend(off) msymbol(o) 


graph export app_d3c.png, width(1000) replace




************************ Fixed effects and round effects ***********************
cls
use data_us, clear
xtset RecordNo round

xtreg elec_prom i.timing i.round, cluster(RecordNo) fe
estimates store timi_us

xtreg elec_prom vote_sender i.round, cluster(RecordNo) fe
estimates store send_us

xtreg elec_prom i.promise i.round, cluster(RecordNo) fe
estimates store prom_us

xtreg elec_prom i.spec i.round, cluster(RecordNo) fe
estimates store spec_us

xtreg elec_prom output i.round, cluster(RecordNo) fe
estimates store out_us

xtreg elec_prom ib2.time i.round, cluster(RecordNo) fe
estimates store time_us

xtreg elec_prom i.cond i.round, cluster(RecordNo) fe
estimates store cond_us


use data_uk, clear
xtset RecordNo round

xtreg elec_prom i.timing i.round, cluster(RecordNo) fe
estimates store timi_en

xtreg elec_prom vote_sender i.round, cluster(RecordNo) fe
estimates store send_en

xtreg elec_prom i.promise i.round, cluster(RecordNo) fe
estimates store prom_en

xtreg elec_prom i.spec i.round, cluster(RecordNo) fe
estimates store spec_en

xtreg elec_prom output i.round, cluster(RecordNo) fe
estimates store out_en

xtreg elec_prom ib2.time i.round, cluster(RecordNo) fe
estimates store time_en

xtreg elec_prom i.cond i.round, cluster(RecordNo) fe
estimates store cond_en


use data_dk, clear
xtset RecordNo round

xtreg elec_prom i.timing i.round, cluster(RecordNo) fe
estimates store timi_dk

xtreg elec_prom vote_sender i.round, cluster(RecordNo) fe
estimates store send_dk

xtreg elec_prom i.promise i.round, cluster(RecordNo) fe
estimates store prom_dk

xtreg elec_prom i.spec i.round, cluster(RecordNo) fe
estimates store spec_dk

xtreg elec_prom output i.round, cluster(RecordNo) fe
estimates store out_dk

xtreg elec_prom ib2.time i.round, cluster(RecordNo) fe
estimates store time_dk

xtreg elec_prom i.cond i.round, cluster(RecordNo) fe
estimates store cond_dk


coefplot (timi_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(send_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(prom_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(spec_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(out_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(time_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(cond_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(timi_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(send_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(prom_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(spec_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(out_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(time_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(cond_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(timi_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(send_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(prom_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(spec_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(out_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(time_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(cond_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))), ///
drop(_cons *.round) yscale(noline alt) grid(glcolor(gs6) glwidth(vthin)) ///
headings(1.timing = "{bf:Timing}" vote_sender = "{bf:Sender}" 1.promise = "{bf:Committing statement}" 1.spec = "{bf:Numeric goal}" 1.time = "{bf:Time horizon}" output = "{bf:Output/outcome}" 1.cond = "{bf:Conditionality}", labgap(-93) nogap labsize(vsmall)) ///
xline(0, lcolor(black) lpattern(shortdash)) ytitle("", size(small)) levels(95) ///
graphregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white) margin(l=30)) coeflabels(, notick labgap(-90)) ///
xsize(14) ysize(20) xlabel(-0.25(0.05)0.2, labsize(vsmall)) ylabel(, labsize(vsmall)) baselevels legend(off) msymbol(o) 


graph export app_d3d.png, width(1000) replace




********************************************************************************
********** Appendix D4: Predicted probabilities of specific statements *********
********************************************************************************


cls
use data_us, clear

reg elec_prom i.timing i.sender ib4.promise i.spec output i.subject_theme ib2.time i.cond, cluster(RecordNo)

margins, at(timing=2 sender=1 promise=1 spec=2 output=1 subject_theme=1 time=3 cond=3)

margins, at(timing=2 sender=1 promise=3 spec=2 output=1 subject_theme=1 time=3 cond=3)

margins, at(timing=2 sender=1 promise=3 spec=2 output=1 subject_theme=1 time=3 cond=2)

margins, at(timing=2 sender=1 promise=3 spec=2 output=0 subject_theme=1 time=3 cond=2)

margins, at(timing=2 sender=1 promise=4 spec=2 output=0 subject_theme=1 time=3 cond=1)


cls
use data_uk, clear

reg elec_prom i.timing i.sender ib4.promise i.spec output i.subject_theme ib2.time i.cond, cluster(RecordNo)

margins, at(timing=2 sender=1 promise=1 spec=2 output=1 subject_theme=1 time=3 cond=3)

margins, at(timing=2 sender=1 promise=3 spec=2 output=1 subject_theme=1 time=3 cond=3)

margins, at(timing=2 sender=1 promise=3 spec=2 output=1 subject_theme=1 time=3 cond=2)

margins, at(timing=2 sender=1 promise=3 spec=2 output=0 subject_theme=1 time=3 cond=2)

margins, at(timing=2 sender=1 promise=4 spec=2 output=0 subject_theme=1 time=3 cond=1)


cls
use data_dk, clear

reg elec_prom i.timing i.sender ib4.promise i.spec output i.subject_theme ib2.time i.cond, cluster(RecordNo)

margins, at(timing=2 sender=1 promise=1 spec=2 output=1 subject_theme=1 time=3 cond=3)

margins, at(timing=2 sender=1 promise=3 spec=2 output=1 subject_theme=1 time=3 cond=3)

margins, at(timing=2 sender=1 promise=3 spec=2 output=1 subject_theme=1 time=3 cond=2)

margins, at(timing=2 sender=1 promise=3 spec=2 output=0 subject_theme=1 time=3 cond=2)

margins, at(timing=2 sender=1 promise=4 spec=2 output=0 subject_theme=1 time=3 cond=1)


********************************************************************************
**Appendix D5: Results across gender, age group, education, and political views*
********************************************************************************


* including respondent controls *
cls
use data_us, clear
reg elec_prom i.timing gender i.profile_age educ left_right, cluster(RecordNo)
estimates store timi_us

reg elec_prom vote_sender gender i.profile_age educ left_right, cluster(RecordNo)
estimates store send_us

reg elec_prom i.promise gender i.profile_age educ left_right, cluster(RecordNo)
estimates store prom_us

reg elec_prom i.spec gender i.profile_age educ left_right, cluster(RecordNo)
estimates store spec_us

reg elec_prom output gender i.profile_age educ left_right, cluster(RecordNo)
estimates store out_us

reg elec_prom ib2.time gender i.profile_age educ left_right, cluster(RecordNo)
estimates store time_us

reg elec_prom i.cond gender i.profile_age educ left_right, cluster(RecordNo)
estimates store cond_us


use data_uk, clear
reg elec_prom i.timing gender i.profile_age educ left_right, cluster(RecordNo)
estimates store timi_en

reg elec_prom vote_sender gender i.profile_age educ left_right, cluster(RecordNo)
estimates store send_en

reg elec_prom i.promise gender i.profile_age educ left_right, cluster(RecordNo)
estimates store prom_en

reg elec_prom i.spec gender i.profile_age educ left_right, cluster(RecordNo)
estimates store spec_en

reg elec_prom output gender i.profile_age educ left_right, cluster(RecordNo)
estimates store out_en

reg elec_prom ib2.time gender i.profile_age educ left_right, cluster(RecordNo)
estimates store time_en

reg elec_prom i.cond gender i.profile_age educ left_right, cluster(RecordNo)
estimates store cond_en


use data_dk, clear

reg elec_prom i.timing gender i.profile_age educ left_right, cluster(RecordNo)
estimates store timi_dk

reg elec_prom vote_sender gender i.profile_age educ left_right, cluster(RecordNo)
estimates store send_dk

reg elec_prom i.promise gender i.profile_age educ left_right, cluster(RecordNo)
estimates store prom_dk

reg elec_prom i.spec gender i.profile_age educ left_right, cluster(RecordNo)
estimates store spec_dk

reg elec_prom output gender i.profile_age educ left_right, cluster(RecordNo)
estimates store out_dk

reg elec_prom ib2.time gender i.profile_age educ left_right, cluster(RecordNo)
estimates store time_dk

reg elec_prom i.cond gender i.profile_age educ left_right, cluster(RecordNo)
estimates store cond_dk


coefplot (timi_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(send_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(prom_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(spec_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(out_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(time_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(cond_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(timi_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(send_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(prom_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(spec_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(out_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(time_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(cond_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(timi_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(send_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(prom_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(spec_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(out_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(time_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(cond_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))), ///
drop(_cons gender *.profile_age educ left_right) yscale(noline alt) grid(glcolor(gs6) glwidth(vthin)) ///
headings(1.timing = "{bf:Timing}" vote_sender = "{bf:Sender}" 1.promise = "{bf:Committing statement}" 1.spec = "{bf:Numeric goal}" 1.time = "{bf:Time horizon}" output = "{bf:Output/outcome}" 1.cond = "{bf:Conditionality}", labgap(-93) nogap labsize(vsmall)) ///
xline(0, lcolor(black) lpattern(shortdash)) ytitle("", size(small)) levels(95) ///
graphregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white) margin(l=30)) coeflabels(, notick labgap(-90)) ///
xsize(14) ysize(20) xlabel(-0.25(0.05)0.2, labsize(vsmall)) ylabel(, labsize(vsmall)) baselevels legend(off) msymbol(o) 



graph export main_results_figure_individualcontrols.png, width(1000) replace





* Gender *
forvalues x = 0(1)1 {
cls
use data_us, clear
reg elec_prom i.timing if gender ==`x', cluster(RecordNo)
estimates store timi_us

reg elec_prom vote_sender if gender ==`x', cluster(RecordNo)
estimates store send_us

reg elec_prom i.promise if gender ==`x', cluster(RecordNo)
estimates store prom_us

reg elec_prom i.spec if gender ==`x', cluster(RecordNo)
estimates store spec_us

reg elec_prom output if gender ==`x', cluster(RecordNo)
estimates store out_us

reg elec_prom ib2.time if gender ==`x', cluster(RecordNo)
estimates store time_us

reg elec_prom i.cond if gender ==`x', cluster(RecordNo)
estimates store cond_us


use data_uk, clear
reg elec_prom i.timing if gender ==`x', cluster(RecordNo)
estimates store timi_en

reg elec_prom vote_sender if gender ==`x', cluster(RecordNo)
estimates store send_en

reg elec_prom i.promise if gender ==`x', cluster(RecordNo)
estimates store prom_en

reg elec_prom i.spec if gender ==`x', cluster(RecordNo)
estimates store spec_en

reg elec_prom output if gender ==`x', cluster(RecordNo)
estimates store out_en

reg elec_prom ib2.time if gender ==`x', cluster(RecordNo)
estimates store time_en

reg elec_prom i.cond if gender ==`x', cluster(RecordNo)
estimates store cond_en


use data_dk, clear

reg elec_prom i.timing if gender ==`x', cluster(RecordNo)
estimates store timi_dk

reg elec_prom vote_sender if gender ==`x', cluster(RecordNo)
estimates store send_dk

reg elec_prom i.promise if gender ==`x', cluster(RecordNo)
estimates store prom_dk

reg elec_prom i.spec if gender ==`x', cluster(RecordNo)
estimates store spec_dk

reg elec_prom output if gender ==`x', cluster(RecordNo)
estimates store out_dk

reg elec_prom ib2.time if gender ==`x', cluster(RecordNo)
estimates store time_dk

reg elec_prom i.cond if gender ==`x', cluster(RecordNo)
estimates store cond_dk


coefplot (timi_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(send_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(prom_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(spec_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(out_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(time_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(cond_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(timi_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(send_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(prom_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(spec_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(out_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(time_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(cond_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(timi_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(send_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(prom_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(spec_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(out_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(time_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(cond_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))), ///
drop(_cons) yscale(noline alt) grid(glcolor(gs6) glwidth(vthin)) ///
headings(1.timing = "{bf:Timing}" vote_sender = "{bf:Sender}" 1.promise = "{bf:Committing statement}" 1.spec = "{bf:Numeric goal}" 1.time = "{bf:Time horizon}" output = "{bf:Output/outcome}" 1.cond = "{bf:Conditionality}", labgap(-93) nogap labsize(vsmall)) ///
xline(0, lcolor(black) lpattern(shortdash)) ytitle("", size(small)) levels(95) ///
graphregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white) margin(l=30)) coeflabels(, notick labgap(-90)) ///
xsize(14) ysize(20) xlabel(-0.25(0.05)0.2, labsize(vsmall)) ylabel(, labsize(vsmall)) baselevels legend(off) msymbol(o) 


graph export main_results_figure_gender_`x'.png, width(1000) replace


}




* Age 1-2 *
cls
use data_us, clear
reg elec_prom i.timing if profile_age <=2, cluster(RecordNo)
estimates store timi_us

reg elec_prom vote_sender if profile_age <=2, cluster(RecordNo)
estimates store send_us

reg elec_prom i.promise if profile_age <=2, cluster(RecordNo)
estimates store prom_us

reg elec_prom i.spec if profile_age <=2, cluster(RecordNo)
estimates store spec_us

reg elec_prom output if profile_age <=2, cluster(RecordNo)
estimates store out_us

reg elec_prom ib2.time if profile_age <=2, cluster(RecordNo)
estimates store time_us

reg elec_prom i.cond if profile_age <=2, cluster(RecordNo)
estimates store cond_us


use data_uk, clear
reg elec_prom i.timing if profile_age <=2, cluster(RecordNo)
estimates store timi_en

reg elec_prom vote_sender if profile_age <=2, cluster(RecordNo)
estimates store send_en

reg elec_prom i.promise if profile_age <=2, cluster(RecordNo)
estimates store prom_en

reg elec_prom i.spec if profile_age <=2, cluster(RecordNo)
estimates store spec_en

reg elec_prom output if profile_age <=2, cluster(RecordNo)
estimates store out_en

reg elec_prom ib2.time if profile_age <=2, cluster(RecordNo)
estimates store time_en

reg elec_prom i.cond if profile_age <=2, cluster(RecordNo)
estimates store cond_en


use data_dk, clear

reg elec_prom i.timing if profile_age <=2, cluster(RecordNo)
estimates store timi_dk

reg elec_prom vote_sender if profile_age <=2, cluster(RecordNo)
estimates store send_dk

reg elec_prom i.promise if profile_age <=2, cluster(RecordNo)
estimates store prom_dk

reg elec_prom i.spec if profile_age <=2, cluster(RecordNo)
estimates store spec_dk

reg elec_prom output if profile_age <=2, cluster(RecordNo)
estimates store out_dk

reg elec_prom ib2.time if profile_age <=2, cluster(RecordNo)
estimates store time_dk

reg elec_prom i.cond if profile_age <=2, cluster(RecordNo)
estimates store cond_dk


coefplot (timi_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(send_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(prom_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(spec_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(out_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(time_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(cond_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(timi_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(send_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(prom_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(spec_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(out_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(time_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(cond_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(timi_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(send_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(prom_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(spec_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(out_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(time_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(cond_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))), ///
drop(_cons) yscale(noline alt) grid(glcolor(gs6) glwidth(vthin)) ///
headings(1.timing = "{bf:Timing}" vote_sender = "{bf:Sender}" 1.promise = "{bf:Committing statement}" 1.spec = "{bf:Numeric goal}" 1.time = "{bf:Time horizon}" output = "{bf:Output/outcome}" 1.cond = "{bf:Conditionality}", labgap(-93) nogap labsize(vsmall)) ///
xline(0, lcolor(black) lpattern(shortdash)) ytitle("", size(small)) levels(95) ///
graphregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white) margin(l=30)) coeflabels(, notick labgap(-90)) ///
xsize(14) ysize(20) xlabel(-0.25(0.05)0.2, labsize(vsmall)) ylabel(, labsize(vsmall)) baselevels legend(off) msymbol(o) 


graph export main_results_figure_agegroup_12.png, width(1000) replace





* Age 3-4 *
cls
use data_us, clear
reg elec_prom i.timing if profile_age >=3 & profile_age <5, cluster(RecordNo)
estimates store timi_us

reg elec_prom vote_sender if profile_age >=3 & profile_age <5, cluster(RecordNo)
estimates store send_us

reg elec_prom i.promise if profile_age >=3 & profile_age <5, cluster(RecordNo)
estimates store prom_us

reg elec_prom i.spec if profile_age >=3 & profile_age <5, cluster(RecordNo)
estimates store spec_us

reg elec_prom output if profile_age >=3 & profile_age <5, cluster(RecordNo)
estimates store out_us

reg elec_prom ib2.time if profile_age >=3 & profile_age <5, cluster(RecordNo)
estimates store time_us

reg elec_prom i.cond if profile_age >=3 & profile_age <5, cluster(RecordNo)
estimates store cond_us


use data_uk, clear
reg elec_prom i.timing if profile_age >=3 & profile_age <5, cluster(RecordNo)
estimates store timi_en

reg elec_prom vote_sender if profile_age >=3 & profile_age <5, cluster(RecordNo)
estimates store send_en

reg elec_prom i.promise if profile_age >=3 & profile_age <5, cluster(RecordNo)
estimates store prom_en

reg elec_prom i.spec if profile_age >=3 & profile_age <5, cluster(RecordNo)
estimates store spec_en

reg elec_prom output if profile_age >=3 & profile_age <5, cluster(RecordNo)
estimates store out_en

reg elec_prom ib2.time if profile_age >=3 & profile_age <5, cluster(RecordNo)
estimates store time_en

reg elec_prom i.cond if profile_age >=3 & profile_age <5, cluster(RecordNo)
estimates store cond_en


use data_dk, clear

reg elec_prom i.timing if profile_age >=3 & profile_age <5, cluster(RecordNo)
estimates store timi_dk

reg elec_prom vote_sender if profile_age >=3 & profile_age <5, cluster(RecordNo)
estimates store send_dk

reg elec_prom i.promise if profile_age >=3 & profile_age <5, cluster(RecordNo)
estimates store prom_dk

reg elec_prom i.spec if profile_age >=3 & profile_age <5, cluster(RecordNo)
estimates store spec_dk

reg elec_prom output if profile_age >=3 & profile_age <5, cluster(RecordNo)
estimates store out_dk

reg elec_prom ib2.time if profile_age >=3 & profile_age <5, cluster(RecordNo)
estimates store time_dk

reg elec_prom i.cond if profile_age >=3 & profile_age <5, cluster(RecordNo)
estimates store cond_dk


coefplot (timi_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(send_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(prom_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(spec_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(out_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(time_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(cond_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(timi_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(send_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(prom_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(spec_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(out_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(time_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(cond_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(timi_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(send_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(prom_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(spec_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(out_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(time_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(cond_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))), ///
drop(_cons) yscale(noline alt) grid(glcolor(gs6) glwidth(vthin)) ///
headings(1.timing = "{bf:Timing}" vote_sender = "{bf:Sender}" 1.promise = "{bf:Committing statement}" 1.spec = "{bf:Numeric goal}" 1.time = "{bf:Time horizon}" output = "{bf:Output/outcome}" 1.cond = "{bf:Conditionality}", labgap(-93) nogap labsize(vsmall)) ///
xline(0, lcolor(black) lpattern(shortdash)) ytitle("", size(small)) levels(95) ///
graphregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white) margin(l=30)) coeflabels(, notick labgap(-90)) ///
xsize(14) ysize(20) xlabel(-0.25(0.05)0.2, labsize(vsmall)) ylabel(, labsize(vsmall)) baselevels legend(off) msymbol(o) 


graph export main_results_figure_agegroup_34.png, width(1000) replace




* Age 5 *
cls
use data_us, clear
reg elec_prom i.timing if profile_age >=5 & profile_age !=., cluster(RecordNo)
estimates store timi_us

reg elec_prom vote_sender if profile_age >=5 & profile_age !=., cluster(RecordNo)
estimates store send_us

reg elec_prom i.promise if profile_age >=5 & profile_age !=., cluster(RecordNo)
estimates store prom_us

reg elec_prom i.spec if profile_age >=5 & profile_age !=., cluster(RecordNo)
estimates store spec_us

reg elec_prom output if profile_age >=5 & profile_age !=., cluster(RecordNo)
estimates store out_us

reg elec_prom ib2.time if profile_age >=5 & profile_age !=., cluster(RecordNo)
estimates store time_us

reg elec_prom i.cond if profile_age >=5 & profile_age !=., cluster(RecordNo)
estimates store cond_us


use data_uk, clear
reg elec_prom i.timing if profile_age >=5 & profile_age !=., cluster(RecordNo)
estimates store timi_en

reg elec_prom vote_sender if profile_age >=5 & profile_age !=., cluster(RecordNo)
estimates store send_en

reg elec_prom i.promise if profile_age >=5 & profile_age !=., cluster(RecordNo)
estimates store prom_en

reg elec_prom i.spec if profile_age >=5 & profile_age !=., cluster(RecordNo)
estimates store spec_en

reg elec_prom output if profile_age >=5 & profile_age !=., cluster(RecordNo)
estimates store out_en

reg elec_prom ib2.time if profile_age >=5 & profile_age !=., cluster(RecordNo)
estimates store time_en

reg elec_prom i.cond if profile_age >=5 & profile_age !=., cluster(RecordNo)
estimates store cond_en


use data_dk, clear

reg elec_prom i.timing if profile_age >=5 & profile_age !=., cluster(RecordNo)
estimates store timi_dk

reg elec_prom vote_sender if profile_age >=5 & profile_age !=., cluster(RecordNo)
estimates store send_dk

reg elec_prom i.promise if profile_age >=5 & profile_age !=., cluster(RecordNo)
estimates store prom_dk

reg elec_prom i.spec if profile_age >=5 & profile_age !=., cluster(RecordNo)
estimates store spec_dk

reg elec_prom output if profile_age >=5 & profile_age !=., cluster(RecordNo)
estimates store out_dk

reg elec_prom ib2.time if profile_age >=5 & profile_age !=., cluster(RecordNo)
estimates store time_dk

reg elec_prom i.cond if profile_age >=5 & profile_age !=., cluster(RecordNo)
estimates store cond_dk


coefplot (timi_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(send_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(prom_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(spec_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(out_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(time_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(cond_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(timi_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(send_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(prom_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(spec_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(out_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(time_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(cond_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(timi_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(send_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(prom_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(spec_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(out_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(time_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(cond_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))), ///
drop(_cons) yscale(noline alt) grid(glcolor(gs6) glwidth(vthin)) ///
headings(1.timing = "{bf:Timing}" vote_sender = "{bf:Sender}" 1.promise = "{bf:Committing statement}" 1.spec = "{bf:Numeric goal}" 1.time = "{bf:Time horizon}" output = "{bf:Output/outcome}" 1.cond = "{bf:Conditionality}", labgap(-93) nogap labsize(vsmall)) ///
xline(0, lcolor(black) lpattern(shortdash)) ytitle("", size(small)) levels(95) ///
graphregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white) margin(l=30)) coeflabels(, notick labgap(-90)) ///
xsize(14) ysize(20) xlabel(-0.25(0.05)0.2, labsize(vsmall)) ylabel(, labsize(vsmall)) baselevels legend(off) msymbol(o) 



graph export main_results_figure_agegroup_5.png, width(1000) replace



* Education *
forvalues x = 0(1)1 {
cls
use data_us, clear
reg elec_prom i.timing if educ ==`x', cluster(RecordNo)
estimates store timi_us

reg elec_prom vote_sender if educ ==`x', cluster(RecordNo)
estimates store send_us

reg elec_prom i.promise if educ ==`x', cluster(RecordNo)
estimates store prom_us

reg elec_prom i.spec if educ ==`x', cluster(RecordNo)
estimates store spec_us

reg elec_prom output if educ ==`x', cluster(RecordNo)
estimates store out_us

reg elec_prom ib2.time if educ ==`x', cluster(RecordNo)
estimates store time_us

reg elec_prom i.cond if educ ==`x', cluster(RecordNo)
estimates store cond_us


use data_uk, clear
reg elec_prom i.timing if educ ==`x', cluster(RecordNo)
estimates store timi_en

reg elec_prom vote_sender if educ ==`x', cluster(RecordNo)
estimates store send_en

reg elec_prom i.promise if educ ==`x', cluster(RecordNo)
estimates store prom_en

reg elec_prom i.spec if educ ==`x', cluster(RecordNo)
estimates store spec_en

reg elec_prom output if educ ==`x', cluster(RecordNo)
estimates store out_en

reg elec_prom ib2.time if educ ==`x', cluster(RecordNo)
estimates store time_en

reg elec_prom i.cond if educ ==`x', cluster(RecordNo)
estimates store cond_en


use data_dk, clear

reg elec_prom i.timing if educ ==`x', cluster(RecordNo)
estimates store timi_dk

reg elec_prom vote_sender if educ ==`x', cluster(RecordNo)
estimates store send_dk

reg elec_prom i.promise if educ ==`x', cluster(RecordNo)
estimates store prom_dk

reg elec_prom i.spec if educ ==`x', cluster(RecordNo)
estimates store spec_dk

reg elec_prom output if educ ==`x', cluster(RecordNo)
estimates store out_dk

reg elec_prom ib2.time if educ ==`x', cluster(RecordNo)
estimates store time_dk

reg elec_prom i.cond if educ ==`x', cluster(RecordNo)
estimates store cond_dk


coefplot (timi_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(send_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(prom_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(spec_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(out_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(time_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(cond_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(timi_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(send_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(prom_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(spec_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(out_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(time_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(cond_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(timi_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(send_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(prom_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(spec_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(out_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(time_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(cond_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))), ///
drop(_cons) yscale(noline alt) grid(glcolor(gs6) glwidth(vthin)) ///
headings(1.timing = "{bf:Timing}" vote_sender = "{bf:Sender}" 1.promise = "{bf:Committing statement}" 1.spec = "{bf:Numeric goal}" 1.time = "{bf:Time horizon}" output = "{bf:Output/outcome}" 1.cond = "{bf:Conditionality}", labgap(-93) nogap labsize(vsmall)) ///
xline(0, lcolor(black) lpattern(shortdash)) ytitle("", size(small)) levels(95) ///
graphregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white) margin(l=30)) coeflabels(, notick labgap(-90)) ///
xsize(14) ysize(20) xlabel(-0.25(0.05)0.2, labsize(vsmall)) ylabel(, labsize(vsmall)) baselevels legend(off) msymbol(o) 



graph export main_results_figure_educ_`x'.png, width(1000) replace

}


* Left-right *
forvalues x = 0(1)2 {
cls
use data_us, clear
reg elec_prom i.timing if left_right ==`x', cluster(RecordNo)
estimates store timi_us

reg elec_prom vote_sender if left_right ==`x', cluster(RecordNo)
estimates store send_us

reg elec_prom i.promise if left_right ==`x', cluster(RecordNo)
estimates store prom_us

reg elec_prom i.spec if left_right ==`x', cluster(RecordNo)
estimates store spec_us

reg elec_prom output if left_right ==`x', cluster(RecordNo)
estimates store out_us

reg elec_prom ib2.time if left_right ==`x', cluster(RecordNo)
estimates store time_us

reg elec_prom i.cond if left_right ==`x', cluster(RecordNo)
estimates store cond_us


use data_uk, clear
reg elec_prom i.timing if left_right ==`x', cluster(RecordNo)
estimates store timi_en

reg elec_prom vote_sender if left_right ==`x', cluster(RecordNo)
estimates store send_en

reg elec_prom i.promise if left_right ==`x', cluster(RecordNo)
estimates store prom_en

reg elec_prom i.spec if left_right ==`x', cluster(RecordNo)
estimates store spec_en

reg elec_prom output if left_right ==`x', cluster(RecordNo)
estimates store out_en

reg elec_prom ib2.time if left_right ==`x', cluster(RecordNo)
estimates store time_en

reg elec_prom i.cond if left_right ==`x', cluster(RecordNo)
estimates store cond_en


use data_dk, clear

reg elec_prom i.timing if left_right ==`x', cluster(RecordNo)
estimates store timi_dk

reg elec_prom vote_sender if left_right ==`x', cluster(RecordNo)
estimates store send_dk

reg elec_prom i.promise if left_right ==`x', cluster(RecordNo)
estimates store prom_dk

reg elec_prom i.spec if left_right ==`x', cluster(RecordNo)
estimates store spec_dk

reg elec_prom output if left_right ==`x', cluster(RecordNo)
estimates store out_dk

reg elec_prom ib2.time if left_right ==`x', cluster(RecordNo)
estimates store time_dk

reg elec_prom i.cond if left_right ==`x', cluster(RecordNo)
estimates store cond_dk


coefplot (timi_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(send_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(prom_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(spec_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(out_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(time_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(cond_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(timi_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(send_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(prom_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(spec_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(out_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(time_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(cond_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(timi_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(send_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(prom_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(spec_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(out_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(time_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(cond_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))), ///
drop(_cons) yscale(noline alt) grid(glcolor(gs6) glwidth(vthin)) ///
headings(1.timing = "{bf:Timing}" vote_sender = "{bf:Sender}" 1.promise = "{bf:Committing statement}" 1.spec = "{bf:Numeric goal}" 1.time = "{bf:Time horizon}" output = "{bf:Output/outcome}" 1.cond = "{bf:Conditionality}", labgap(-93) nogap labsize(vsmall)) ///
xline(0, lcolor(black) lpattern(shortdash)) ytitle("", size(small)) levels(95) ///
graphregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white) margin(l=30)) coeflabels(, notick labgap(-90)) ///
xsize(14) ysize(20) xlabel(-0.25(0.05)0.2, labsize(vsmall)) ylabel(, labsize(vsmall)) baselevels legend(off) msymbol(o) 



graph export main_results_figure_leftright_`x'.png, width(1000) replace


}

********************************************************************************
***************** Appendix D6: Separate analyses across issues *****************
********************************************************************************


*** Health ***

cls
use data_us, clear
reg elec_prom i.timing if subject_theme == 1, cluster(RecordNo)
estimates store timi_us

reg elec_prom vote_sender if subject_theme == 1, cluster(RecordNo)
estimates store send_us

reg elec_prom i.promise if subject_theme == 1, cluster(RecordNo)
estimates store prom_us

reg elec_prom i.spec if subject_theme == 1, cluster(RecordNo)
estimates store spec_us

reg elec_prom output if subject_theme == 1, cluster(RecordNo)
estimates store out_us

reg elec_prom ib2.time if subject_theme == 1, cluster(RecordNo)
estimates store time_us

reg elec_prom i.cond if subject_theme == 1, cluster(RecordNo)
estimates store cond_us


use data_uk, clear
reg elec_prom i.timing if subject_theme == 1, cluster(RecordNo)
estimates store timi_en

reg elec_prom vote_sender if subject_theme == 1, cluster(RecordNo)
estimates store send_en

reg elec_prom i.promise if subject_theme == 1, cluster(RecordNo)
estimates store prom_en

reg elec_prom i.spec if subject_theme == 1, cluster(RecordNo)
estimates store spec_en

reg elec_prom output if subject_theme == 1, cluster(RecordNo)
estimates store out_en

reg elec_prom ib2.time if subject_theme == 1, cluster(RecordNo)
estimates store time_en

reg elec_prom i.cond if subject_theme == 1, cluster(RecordNo)
estimates store cond_en


use data_dk, clear

reg elec_prom i.timing if subject_theme == 1, cluster(RecordNo)
estimates store timi_dk

reg elec_prom vote_sender if subject_theme == 1, cluster(RecordNo)
estimates store send_dk

reg elec_prom i.promise if subject_theme == 1, cluster(RecordNo)
estimates store prom_dk

reg elec_prom i.spec if subject_theme == 1, cluster(RecordNo)
estimates store spec_dk

reg elec_prom output if subject_theme == 1, cluster(RecordNo)
estimates store out_dk

reg elec_prom ib2.time if subject_theme == 1, cluster(RecordNo)
estimates store time_dk

reg elec_prom i.cond if subject_theme == 1, cluster(RecordNo)
estimates store cond_dk


coefplot (timi_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(send_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(prom_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(spec_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(out_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(time_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(cond_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(timi_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(send_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(prom_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(spec_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(out_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(time_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(cond_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(timi_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(send_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(prom_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(spec_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(out_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(time_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(cond_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))), ///
drop(_cons) yscale(noline alt) grid(glcolor(gs6) glwidth(vthin)) ///
headings(1.timing = "{bf:Timing}" vote_sender = "{bf:Sender}" 1.promise = "{bf:Committing statement}" 1.spec = "{bf:Numeric goal}" 1.time = "{bf:Time horizon}" output = "{bf:Output/outcome}" 1.cond = "{bf:Conditionality}", labgap(-93) nogap labsize(vsmall)) ///
xline(0, lcolor(black) lpattern(shortdash)) ytitle("", size(small)) levels(95) ///
graphregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white) margin(l=30)) coeflabels(, notick labgap(-90)) ///
xsize(14) ysize(20) xlabel(-0.25(0.05)0.2, labsize(vsmall)) ylabel(, labsize(vsmall)) baselevels legend(off) msymbol(o) 



graph export main_results_figure_subject_1.png, width(1000) replace



*** Immigration ***

cls
use data_us, clear
reg elec_prom i.timing if subject_theme == 2, cluster(RecordNo)
estimates store timi_us

reg elec_prom vote_sender if subject_theme == 2, cluster(RecordNo)
estimates store send_us

reg elec_prom i.promise if subject_theme == 2, cluster(RecordNo)
estimates store prom_us

reg elec_prom i.spec if subject_theme == 2, cluster(RecordNo)
estimates store spec_us

reg elec_prom output if subject_theme == 2, cluster(RecordNo)
estimates store out_us

reg elec_prom ib2.time if subject_theme == 2, cluster(RecordNo)
estimates store time_us

reg elec_prom i.cond if subject_theme == 2, cluster(RecordNo)
estimates store cond_us


use data_uk, clear
reg elec_prom i.timing if subject_theme == 2, cluster(RecordNo)
estimates store timi_en

reg elec_prom vote_sender if subject_theme == 2, cluster(RecordNo)
estimates store send_en

reg elec_prom i.promise if subject_theme == 2, cluster(RecordNo)
estimates store prom_en

reg elec_prom i.spec if subject_theme == 2, cluster(RecordNo)
estimates store spec_en

reg elec_prom output if subject_theme == 2, cluster(RecordNo)
estimates store out_en

reg elec_prom ib2.time if subject_theme == 2, cluster(RecordNo)
estimates store time_en

reg elec_prom i.cond if subject_theme == 2, cluster(RecordNo)
estimates store cond_en


use data_dk, clear

reg elec_prom i.timing if subject_theme == 2, cluster(RecordNo)
estimates store timi_dk

reg elec_prom vote_sender if subject_theme == 2, cluster(RecordNo)
estimates store send_dk

reg elec_prom i.promise if subject_theme == 2, cluster(RecordNo)
estimates store prom_dk

reg elec_prom i.spec if subject_theme == 2, cluster(RecordNo)
estimates store spec_dk

reg elec_prom output if subject_theme == 2, cluster(RecordNo)
estimates store out_dk

reg elec_prom ib2.time if subject_theme == 2, cluster(RecordNo)
estimates store time_dk

reg elec_prom i.cond if subject_theme == 2, cluster(RecordNo)
estimates store cond_dk


coefplot (timi_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(send_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(prom_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(spec_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(out_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(time_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(cond_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(timi_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(send_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(prom_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(spec_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(out_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(time_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(cond_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(timi_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(send_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(prom_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(spec_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(out_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(time_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(cond_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))), ///
drop(_cons) yscale(noline alt) grid(glcolor(gs6) glwidth(vthin)) ///
headings(1.timing = "{bf:Timing}" vote_sender = "{bf:Sender}" 1.promise = "{bf:Committing statement}" 1.spec = "{bf:Numeric goal}" 1.time = "{bf:Time horizon}" output = "{bf:Output/outcome}" 1.cond = "{bf:Conditionality}", labgap(-93) nogap labsize(vsmall)) ///
xline(0, lcolor(black) lpattern(shortdash)) ytitle("", size(small)) levels(95) ///
graphregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white) margin(l=30)) coeflabels(, notick labgap(-90)) ///
xsize(14) ysize(20) xlabel(-0.25(0.05)0.2, labsize(vsmall)) ylabel(, labsize(vsmall)) baselevels legend(off) msymbol(o) 



graph export main_results_figure_subject_2.png, width(1000) replace



*** Labour ***
cls
use data_us, clear
reg elec_prom i.timing if subject_theme ==3, cluster(RecordNo)
estimates store timi_us

reg elec_prom vote_sender if subject_theme ==3, cluster(RecordNo)
estimates store send_us

reg elec_prom i.promise if subject_theme ==3, cluster(RecordNo)
estimates store prom_us

reg elec_prom i.spec if subject_theme ==3, cluster(RecordNo)
estimates store spec_us

reg elec_prom output if subject_theme ==3, cluster(RecordNo)
estimates store out_us

reg elec_prom ib2.time if subject_theme ==3, cluster(RecordNo)
estimates store time_us

reg elec_prom i.cond if subject_theme ==3, cluster(RecordNo)
estimates store cond_us


use data_uk, clear
reg elec_prom i.timing if subject_theme ==3, cluster(RecordNo)
estimates store timi_en

reg elec_prom vote_sender if subject_theme ==3, cluster(RecordNo)
estimates store send_en

reg elec_prom i.promise if subject_theme ==3, cluster(RecordNo)
estimates store prom_en

reg elec_prom i.spec if subject_theme ==3, cluster(RecordNo)
estimates store spec_en

reg elec_prom output if subject_theme ==3, cluster(RecordNo)
estimates store out_en

reg elec_prom ib2.time if subject_theme ==3, cluster(RecordNo)
estimates store time_en

reg elec_prom i.cond if subject_theme ==3, cluster(RecordNo)
estimates store cond_en


use data_dk, clear

reg elec_prom i.timing if subject_theme ==3, cluster(RecordNo)
estimates store timi_dk

reg elec_prom vote_sender if subject_theme ==3, cluster(RecordNo)
estimates store send_dk

reg elec_prom i.promise if subject_theme ==3, cluster(RecordNo)
estimates store prom_dk

reg elec_prom i.spec if subject_theme ==3, cluster(RecordNo)
estimates store spec_dk

reg elec_prom output if subject_theme ==3, cluster(RecordNo)
estimates store out_dk

reg elec_prom ib2.time if subject_theme ==3, cluster(RecordNo)
estimates store time_dk

reg elec_prom i.cond if subject_theme ==3, cluster(RecordNo)
estimates store cond_dk


coefplot (timi_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(send_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(prom_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(spec_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(out_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(time_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(cond_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(timi_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(send_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(prom_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(spec_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(out_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(time_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(cond_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(timi_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(send_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(prom_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(spec_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(out_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(time_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(cond_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))), ///
drop(_cons) yscale(noline alt) grid(glcolor(gs6) glwidth(vthin)) ///
headings(1.timing = "{bf:Timing}" vote_sender = "{bf:Sender}" 1.promise = "{bf:Committing statement}" 1.spec = "{bf:Numeric goal}" 1.time = "{bf:Time horizon}" output = "{bf:Output/outcome}" 1.cond = "{bf:Conditionality}", labgap(-93) nogap labsize(vsmall)) ///
xline(0, lcolor(black) lpattern(shortdash)) ytitle("", size(small)) levels(95) ///
graphregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white) margin(l=30)) coeflabels(, notick labgap(-90)) ///
xsize(14) ysize(20) xlabel(-0.25(0.05)0.2, labsize(vsmall)) ylabel(, labsize(vsmall)) baselevels legend(off) msymbol(o) 



graph export main_results_figure_subject_3.png, width(1000) replace





*** Olympics ***

cls
use data_us, clear
reg elec_prom i.timing if subject_theme == 4, cluster(RecordNo)
estimates store timi_us

reg elec_prom vote_sender if subject_theme == 4, cluster(RecordNo)
estimates store send_us

reg elec_prom i.promise if subject_theme == 4, cluster(RecordNo)
estimates store prom_us

reg elec_prom i.spec if subject_theme == 4, cluster(RecordNo)
estimates store spec_us

reg elec_prom output if subject_theme == 4, cluster(RecordNo)
estimates store out_us

reg elec_prom ib2.time if subject_theme == 4, cluster(RecordNo)
estimates store time_us

reg elec_prom i.cond if subject_theme == 4, cluster(RecordNo)
estimates store cond_us


use data_uk, clear
reg elec_prom i.timing if subject_theme == 4, cluster(RecordNo)
estimates store timi_en

reg elec_prom vote_sender if subject_theme == 4, cluster(RecordNo)
estimates store send_en

reg elec_prom i.promise if subject_theme == 4, cluster(RecordNo)
estimates store prom_en

reg elec_prom i.spec if subject_theme == 4, cluster(RecordNo)
estimates store spec_en

reg elec_prom output if subject_theme == 4, cluster(RecordNo)
estimates store out_en

reg elec_prom ib2.time if subject_theme == 4, cluster(RecordNo)
estimates store time_en

reg elec_prom i.cond if subject_theme == 4, cluster(RecordNo)
estimates store cond_en


use data_dk, clear

reg elec_prom i.timing if subject_theme == 4, cluster(RecordNo)
estimates store timi_dk

reg elec_prom vote_sender if subject_theme == 4, cluster(RecordNo)
estimates store send_dk

reg elec_prom i.promise if subject_theme == 4, cluster(RecordNo)
estimates store prom_dk

reg elec_prom i.spec if subject_theme == 4, cluster(RecordNo)
estimates store spec_dk

reg elec_prom output if subject_theme == 4, cluster(RecordNo)
estimates store out_dk

reg elec_prom ib2.time if subject_theme == 4, cluster(RecordNo)
estimates store time_dk

reg elec_prom i.cond if subject_theme == 4, cluster(RecordNo)
estimates store cond_dk


coefplot (timi_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(send_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(prom_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(spec_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(out_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(time_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(cond_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(timi_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(send_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(prom_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(spec_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(out_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(time_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(cond_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(timi_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(send_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(prom_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(spec_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(out_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(time_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(cond_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))), ///
drop(_cons) yscale(noline alt) grid(glcolor(gs6) glwidth(vthin)) ///
headings(1.timing = "{bf:Timing}" vote_sender = "{bf:Sender}" 1.promise = "{bf:Committing statement}" 1.spec = "{bf:Numeric goal}" 1.time = "{bf:Time horizon}" output = "{bf:Output/outcome}" 1.cond = "{bf:Conditionality}", labgap(-93) nogap labsize(vsmall)) ///
xline(0, lcolor(black) lpattern(shortdash)) ytitle("", size(small)) levels(95) ///
graphregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white) margin(l=30)) coeflabels(, notick labgap(-90)) ///
xsize(14) ysize(20) xlabel(-0.25(0.05)0.2, labsize(vsmall)) ylabel(, labsize(vsmall)) baselevels legend(off) msymbol(o) 



graph export main_results_figure_subject_4.png, width(1000) replace




********************************************************************************
************ Appendix D7: Examining the direct effect of senders ***************
********************************************************************************

cls
use data_us, clear
reg elec_prom i.sender2, cluster(RecordNo)
estimates store send_us_dir


use data_uk, clear
reg elec_prom i.sender2, cluster(RecordNo)
estimates store send_en_dir

use data_dk, clear
reg elec_prom i.sender2, cluster(RecordNo)
estimates store send_dk_dir


coefplot (send_dk_dir, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(send_en_dir, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(send_us_dir, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))), ///
drop(_cons) yscale(noline alt) grid(glcolor(gs6) glwidth(vthin)) ///
headings(vote_sender = "{bf:Sender}", labgap(-93) nogap labsize(vsmall)) ///
xline(0, lcolor(black) lpattern(shortdash)) ytitle("", size(small)) levels(95) ///
graphregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white) margin(l=30)) coeflabels(, notick labgap(-90)) ///
xsize(14) ysize(20) xlabel(-0.25(0.05)0.2, labsize(vsmall)) ylabel(, labsize(vsmall)) baselevels legend(off) msymbol(o) 



graph export app_d7.png, width(1000) replace




********************************************************************************
****************** Appendix D8: Examining ordering effects *********************
********************************************************************************

forvalues r = 1(1)4 {


cls
use data_us, clear
reg elec_prom i.timing if round == `r', cluster(RecordNo)
estimates store timi_us

reg elec_prom vote_sender if round == `r', cluster(RecordNo)
estimates store send_us

reg elec_prom i.promise if round == `r', cluster(RecordNo)
estimates store prom_us

reg elec_prom i.spec if round == `r', cluster(RecordNo)
estimates store spec_us

reg elec_prom output if round == `r', cluster(RecordNo)
estimates store out_us

reg elec_prom ib2.time if round == `r', cluster(RecordNo)
estimates store time_us

reg elec_prom i.cond if round == `r', cluster(RecordNo)
estimates store cond_us


use data_uk, clear
reg elec_prom i.timing if round == `r', cluster(RecordNo)
estimates store timi_en

reg elec_prom vote_sender if round == `r', cluster(RecordNo)
estimates store send_en

reg elec_prom i.promise if round == `r', cluster(RecordNo)
estimates store prom_en

reg elec_prom i.spec if round == `r', cluster(RecordNo)
estimates store spec_en

reg elec_prom output if round == `r', cluster(RecordNo)
estimates store out_en

reg elec_prom ib2.time if round == `r', cluster(RecordNo)
estimates store time_en

reg elec_prom i.cond if round == `r', cluster(RecordNo)
estimates store cond_en


use data_dk, clear

reg elec_prom i.timing if round == `r', cluster(RecordNo)
estimates store timi_dk

reg elec_prom vote_sender if round == `r', cluster(RecordNo)
estimates store send_dk

reg elec_prom i.promise if round == `r', cluster(RecordNo)
estimates store prom_dk

reg elec_prom i.spec if round == `r', cluster(RecordNo)
estimates store spec_dk

reg elec_prom output if round == `r', cluster(RecordNo)
estimates store out_dk

reg elec_prom ib2.time if round == `r', cluster(RecordNo)
estimates store time_dk

reg elec_prom i.cond if round == `r', cluster(RecordNo)
estimates store cond_dk

coefplot (timi_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(send_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(prom_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(spec_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(out_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(time_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(cond_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(timi_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(send_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(prom_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(spec_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(out_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(time_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(cond_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(timi_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(send_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(prom_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(spec_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(out_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(time_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(cond_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))), ///
drop(_cons) yscale(noline alt) grid(glcolor(gs6) glwidth(vthin)) ///
headings(1.timing = "{bf:Timing}" vote_sender = "{bf:Sender}" 1.promise = "{bf:Committing statement}" 1.spec = "{bf:Numeric goal}" 1.time = "{bf:Time horizon}" output = "{bf:Output/outcome}" 1.cond = "{bf:Conditionality}", labgap(-93) nogap labsize(vsmall)) ///
xline(0, lcolor(black) lpattern(shortdash)) ytitle("", size(small)) levels(95) ///
graphregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white) margin(l=30)) coeflabels(, notick labgap(-90)) ///
xsize(14) ysize(20) xlabel(-0.25(0.05)0.2, labsize(vsmall)) ylabel(, labsize(vsmall)) baselevels legend(off) msymbol(o) 


graph export app_d8_round`r'.png, width(3000) replace


}


********************************************************************************
*********** Appendix D9: Examining interaction between attributes **************
********************************************************************************

*** Promise ==1 ***
cls
use data_us, clear
reg elec_prom i.timing if promise==1, cluster(RecordNo)
estimates store timi_us

reg elec_prom vote_sender if promise==1, cluster(RecordNo)
estimates store send_us

reg elec_prom i.promise if promise==1, cluster(RecordNo)
estimates store prom_us

reg elec_prom i.spec if promise==1, cluster(RecordNo)
estimates store spec_us

reg elec_prom output if promise==1, cluster(RecordNo)
estimates store out_us

reg elec_prom ib2.time if promise==1, cluster(RecordNo)
estimates store time_us

reg elec_prom i.cond if promise==1, cluster(RecordNo)
estimates store cond_us


use data_uk, clear
reg elec_prom i.timing if promise==1, cluster(RecordNo)
estimates store timi_en

reg elec_prom vote_sender if promise==1, cluster(RecordNo)
estimates store send_en

reg elec_prom i.promise if promise==1, cluster(RecordNo)
estimates store prom_en

reg elec_prom i.spec if promise==1, cluster(RecordNo)
estimates store spec_en

reg elec_prom output if promise==1, cluster(RecordNo)
estimates store out_en

reg elec_prom ib2.time if promise==1, cluster(RecordNo)
estimates store time_en

reg elec_prom i.cond if promise==1, cluster(RecordNo)
estimates store cond_en


use data_dk, clear

reg elec_prom i.timing if promise==1, cluster(RecordNo)
estimates store timi_dk

reg elec_prom vote_sender if promise==1, cluster(RecordNo)
estimates store send_dk

reg elec_prom i.promise if promise==1, cluster(RecordNo)
estimates store prom_dk

reg elec_prom i.spec if promise==1, cluster(RecordNo)
estimates store spec_dk

reg elec_prom output if promise==1, cluster(RecordNo)
estimates store out_dk

reg elec_prom ib2.time if promise==1, cluster(RecordNo)
estimates store time_dk

reg elec_prom i.cond if promise==1, cluster(RecordNo)
estimates store cond_dk


coefplot (timi_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(send_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(prom_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(spec_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(out_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(time_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(cond_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(timi_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(send_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(prom_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(spec_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(out_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(time_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(cond_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(timi_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(send_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(prom_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(spec_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(out_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(time_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(cond_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))), ///
drop(_cons) yscale(noline alt) grid(glcolor(gs6) glwidth(vthin)) ///
headings(1.timing = "{bf:Timing}" vote_sender = "{bf:Sender}" 1.promise = "{bf:Committing statement}" 1.spec = "{bf:Numeric goal}" 1.time = "{bf:Time horizon}" output = "{bf:Output/outcome}" 1.cond = "{bf:Conditionality}", labgap(-93) nogap labsize(vsmall)) ///
xline(0, lcolor(black) lpattern(shortdash)) ytitle("", size(small)) levels(95) ///
graphregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white) margin(l=30)) coeflabels(, notick labgap(-90)) ///
xsize(14) ysize(20) xlabel(-0.25(0.05)0.2, labsize(vsmall)) ylabel(, labsize(vsmall)) baselevels legend(off) msymbol(o) 


graph export D9a_promise1.png, width(1000) replace



*** Promise ==4 ***
cls
use data_us, clear
reg elec_prom i.timing if promise==4, cluster(RecordNo)
estimates store timi_us

reg elec_prom vote_sender if promise==4, cluster(RecordNo)
estimates store send_us

reg elec_prom i.promise if promise==4, cluster(RecordNo)
estimates store prom_us

reg elec_prom i.spec if promise==4, cluster(RecordNo)
estimates store spec_us

reg elec_prom output if promise==4, cluster(RecordNo)
estimates store out_us

reg elec_prom ib2.time if promise==4, cluster(RecordNo)
estimates store time_us

reg elec_prom i.cond if promise==4, cluster(RecordNo)
estimates store cond_us


use data_uk, clear
reg elec_prom i.timing if promise==4, cluster(RecordNo)
estimates store timi_en

reg elec_prom vote_sender if promise==4, cluster(RecordNo)
estimates store send_en

reg elec_prom i.promise if promise==4, cluster(RecordNo)
estimates store prom_en

reg elec_prom i.spec if promise==4, cluster(RecordNo)
estimates store spec_en

reg elec_prom output if promise==4, cluster(RecordNo)
estimates store out_en

reg elec_prom ib2.time if promise==4, cluster(RecordNo)
estimates store time_en

reg elec_prom i.cond if promise==4, cluster(RecordNo)
estimates store cond_en


use data_dk, clear

reg elec_prom i.timing if promise==4, cluster(RecordNo)
estimates store timi_dk

reg elec_prom vote_sender if promise==4, cluster(RecordNo)
estimates store send_dk

reg elec_prom i.promise if promise==4, cluster(RecordNo)
estimates store prom_dk

reg elec_prom i.spec if promise==4, cluster(RecordNo)
estimates store spec_dk

reg elec_prom output if promise==4, cluster(RecordNo)
estimates store out_dk

reg elec_prom ib2.time if promise==4, cluster(RecordNo)
estimates store time_dk

reg elec_prom i.cond if promise==4, cluster(RecordNo)
estimates store cond_dk


coefplot (timi_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(send_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(prom_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(spec_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(out_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(time_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(cond_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(timi_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(send_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(prom_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(spec_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(out_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(time_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(cond_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(timi_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(send_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(prom_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(spec_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(out_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(time_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(cond_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))), ///
drop(_cons) yscale(noline alt) grid(glcolor(gs6) glwidth(vthin)) ///
headings(1.timing = "{bf:Timing}" vote_sender = "{bf:Sender}" 1.promise = "{bf:Committing statement}" 1.spec = "{bf:Numeric goal}" 1.time = "{bf:Time horizon}" output = "{bf:Output/outcome}" 1.cond = "{bf:Conditionality}", labgap(-93) nogap labsize(vsmall)) ///
xline(0, lcolor(black) lpattern(shortdash)) ytitle("", size(small)) levels(95) ///
graphregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white) margin(l=30)) coeflabels(, notick labgap(-90)) ///
xsize(14) ysize(20) xlabel(-0.25(0.05)0.2, labsize(vsmall)) ylabel(, labsize(vsmall)) baselevels legend(off) msymbol(o) 


graph export D9b_promise4.png, width(1000) replace



*** cond ==1 ***
cls
use data_us, clear
reg elec_prom i.timing if cond==1, cluster(RecordNo)
estimates store timi_us

reg elec_prom vote_sender if cond==1, cluster(RecordNo)
estimates store send_us

reg elec_prom i.promise if cond==1, cluster(RecordNo)
estimates store prom_us

reg elec_prom i.spec if cond==1, cluster(RecordNo)
estimates store spec_us

reg elec_prom output if cond==1, cluster(RecordNo)
estimates store out_us

reg elec_prom ib2.time if cond==1, cluster(RecordNo)
estimates store time_us

reg elec_prom i.cond if cond==1, cluster(RecordNo)
estimates store cond_us


use data_uk, clear
reg elec_prom i.timing if cond==1, cluster(RecordNo)
estimates store timi_en

reg elec_prom vote_sender if cond==1, cluster(RecordNo)
estimates store send_en

reg elec_prom i.promise if cond==1, cluster(RecordNo)
estimates store prom_en

reg elec_prom i.spec if cond==1, cluster(RecordNo)
estimates store spec_en

reg elec_prom output if cond==1, cluster(RecordNo)
estimates store out_en

reg elec_prom ib2.time if cond==1, cluster(RecordNo)
estimates store time_en

reg elec_prom i.cond if cond==1, cluster(RecordNo)
estimates store cond_en


use data_dk, clear

reg elec_prom i.timing if cond==1, cluster(RecordNo)
estimates store timi_dk

reg elec_prom vote_sender if cond==1, cluster(RecordNo)
estimates store send_dk

reg elec_prom i.promise if cond==1, cluster(RecordNo)
estimates store prom_dk

reg elec_prom i.spec if cond==1, cluster(RecordNo)
estimates store spec_dk

reg elec_prom output if cond==1, cluster(RecordNo)
estimates store out_dk

reg elec_prom ib2.time if cond==1, cluster(RecordNo)
estimates store time_dk

reg elec_prom i.cond if cond==1, cluster(RecordNo)
estimates store cond_dk


coefplot (timi_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(send_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(prom_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(spec_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(out_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(time_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(cond_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(timi_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(send_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(prom_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(spec_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(out_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(time_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(cond_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(timi_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(send_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(prom_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(spec_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(out_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(time_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(cond_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))), ///
drop(_cons) yscale(noline alt) grid(glcolor(gs6) glwidth(vthin)) ///
headings(1.timing = "{bf:Timing}" vote_sender = "{bf:Sender}" 1.promise = "{bf:Committing statement}" 1.spec = "{bf:Numeric goal}" 1.time = "{bf:Time horizon}" output = "{bf:Output/outcome}" 1.cond = "{bf:Conditionality}", labgap(-93) nogap labsize(vsmall)) ///
xline(0, lcolor(black) lpattern(shortdash)) ytitle("", size(small)) levels(95) ///
graphregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white) margin(l=30)) coeflabels(, notick labgap(-90)) ///
xsize(14) ysize(20) xlabel(-0.25(0.05)0.2, labsize(vsmall)) ylabel(, labsize(vsmall)) baselevels legend(off) msymbol(o) 


graph export D9c_cond1.png, width(1000) replace




*** cond ==4 ***
cls
use data_us, clear
reg elec_prom i.timing if cond==4, cluster(RecordNo)
estimates store timi_us

reg elec_prom vote_sender if cond==4, cluster(RecordNo)
estimates store send_us

reg elec_prom i.promise if cond==4, cluster(RecordNo)
estimates store prom_us

reg elec_prom i.spec if cond==4, cluster(RecordNo)
estimates store spec_us

reg elec_prom output if cond==4, cluster(RecordNo)
estimates store out_us

reg elec_prom ib2.time if cond==4, cluster(RecordNo)
estimates store time_us

reg elec_prom i.cond if cond==4, cluster(RecordNo)
estimates store cond_us


use data_uk, clear
reg elec_prom i.timing if cond==4, cluster(RecordNo)
estimates store timi_en

reg elec_prom vote_sender if cond==4, cluster(RecordNo)
estimates store send_en

reg elec_prom i.promise if cond==4, cluster(RecordNo)
estimates store prom_en

reg elec_prom i.spec if cond==4, cluster(RecordNo)
estimates store spec_en

reg elec_prom output if cond==4, cluster(RecordNo)
estimates store out_en

reg elec_prom ib2.time if cond==4, cluster(RecordNo)
estimates store time_en

reg elec_prom i.cond if cond==4, cluster(RecordNo)
estimates store cond_en


use data_dk, clear

reg elec_prom i.timing if cond==4, cluster(RecordNo)
estimates store timi_dk

reg elec_prom vote_sender if cond==4, cluster(RecordNo)
estimates store send_dk

reg elec_prom i.promise if cond==4, cluster(RecordNo)
estimates store prom_dk

reg elec_prom i.spec if cond==4, cluster(RecordNo)
estimates store spec_dk

reg elec_prom output if cond==4, cluster(RecordNo)
estimates store out_dk

reg elec_prom ib2.time if cond==4, cluster(RecordNo)
estimates store time_dk

reg elec_prom i.cond if cond==4, cluster(RecordNo)
estimates store cond_dk


coefplot (timi_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(send_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(prom_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(spec_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(out_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(time_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(cond_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(timi_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(send_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(prom_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(spec_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(out_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(time_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(cond_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(timi_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(send_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(prom_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(spec_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(out_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(time_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(cond_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))), ///
drop(_cons) yscale(noline alt) grid(glcolor(gs6) glwidth(vthin)) ///
headings(1.timing = "{bf:Timing}" vote_sender = "{bf:Sender}" 1.promise = "{bf:Committing statement}" 1.spec = "{bf:Numeric goal}" 1.time = "{bf:Time horizon}" output = "{bf:Output/outcome}" 1.cond = "{bf:Conditionality}", labgap(-93) nogap labsize(vsmall)) ///
xline(0, lcolor(black) lpattern(shortdash)) ytitle("", size(small)) levels(95) ///
graphregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white) margin(l=30)) coeflabels(, notick labgap(-90)) ///
xsize(14) ysize(20) xlabel(-0.25(0.05)0.2, labsize(vsmall)) ylabel(, labsize(vsmall)) baselevels legend(off) msymbol(o) 


graph export D9d_cond4.png, width(1000) replace


*** output ==1 ***
cls
use data_us, clear
reg elec_prom i.timing if output==1, cluster(RecordNo)
estimates store timi_us

reg elec_prom vote_sender if output==1, cluster(RecordNo)
estimates store send_us

reg elec_prom i.promise if output==1, cluster(RecordNo)
estimates store prom_us

reg elec_prom i.spec if output==1, cluster(RecordNo)
estimates store spec_us

reg elec_prom output if output==1, cluster(RecordNo)
estimates store out_us

reg elec_prom ib2.time if output==1, cluster(RecordNo)
estimates store time_us

reg elec_prom i.cond if output==1, cluster(RecordNo)
estimates store cond_us


use data_uk, clear
reg elec_prom i.timing if output==1, cluster(RecordNo)
estimates store timi_en

reg elec_prom vote_sender if output==1, cluster(RecordNo)
estimates store send_en

reg elec_prom i.promise if output==1, cluster(RecordNo)
estimates store prom_en

reg elec_prom i.spec if output==1, cluster(RecordNo)
estimates store spec_en

reg elec_prom output if output==1, cluster(RecordNo)
estimates store out_en

reg elec_prom ib2.time if output==1, cluster(RecordNo)
estimates store time_en

reg elec_prom i.cond if output==1, cluster(RecordNo)
estimates store cond_en


use data_dk, clear

reg elec_prom i.timing if output==1, cluster(RecordNo)
estimates store timi_dk

reg elec_prom vote_sender if output==1, cluster(RecordNo)
estimates store send_dk

reg elec_prom i.promise if output==1, cluster(RecordNo)
estimates store prom_dk

reg elec_prom i.spec if output==1, cluster(RecordNo)
estimates store spec_dk

reg elec_prom output if output==1, cluster(RecordNo)
estimates store out_dk

reg elec_prom ib2.time if output==1, cluster(RecordNo)
estimates store time_dk

reg elec_prom i.cond if output==1, cluster(RecordNo)
estimates store cond_dk


coefplot (timi_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(send_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(prom_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(spec_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(out_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(time_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(cond_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(timi_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(send_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(prom_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(spec_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(out_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(time_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(cond_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(timi_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(send_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(prom_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(spec_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(out_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(time_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(cond_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))), ///
drop(_cons) yscale(noline alt) grid(glcolor(gs6) glwidth(vthin)) ///
headings(1.timing = "{bf:Timing}" vote_sender = "{bf:Sender}" 1.promise = "{bf:Committing statement}" 1.spec = "{bf:Numeric goal}" 1.time = "{bf:Time horizon}" output = "{bf:Output/outcome}" 1.cond = "{bf:Conditionality}", labgap(-93) nogap labsize(vsmall)) ///
xline(0, lcolor(black) lpattern(shortdash)) ytitle("", size(small)) levels(95) ///
graphregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white) margin(l=30)) coeflabels(, notick labgap(-90)) ///
xsize(14) ysize(20) xlabel(-0.25(0.05)0.2, labsize(vsmall)) ylabel(, labsize(vsmall)) baselevels legend(off) msymbol(o) 


graph export D9e_output1.png, width(1000) replace




********************************************************************************
********************* Appendix E2: Full mediation analysis *********************
********************************************************************************

**************************** Comitting statement *******************************

use data_all, clear

* US *
local x  promise_2  promise_3
local T promise_4
local M send_prior
local Y elec_prom
medeff (regress `M' `T' `x') (logit `Y' `T' `M' `x') if COUNTRY_DATA=="United States", treat(`T' 0 1) mediate(`M') sims(1000) vce(cluster RecordNo)
gen acme_con_pri_us = r(delta1)
gen acme_hi_con_pri_us = r(delta1hi)
gen acme_lo_con_pri_us = r(delta1lo)
gen acme_perc_con_pri_us = r(navg)


local x  promise_2  promise_3
local T promise_4
local M pol_real
local Y elec_prom
medeff (regress `M' `T' `x') (logit `Y' `T' `M' `x') if COUNTRY_DATA=="United States", treat(`T' 0 1) mediate(`M') sims(1000) vce(cluster RecordNo)
gen acme_con_rea_us = r(delta1)
gen acme_hi_con_rea_us = r(delta1hi)
gen acme_lo_con_rea_us = r(delta1lo)
gen acme_perc_con_rea_us = r(navg)
  

local x  promise_2  promise_3
local T promise_4
local M nocontr
local Y elec_prom
medeff (regress `M' `T' `x') (logit `Y' `T' `M' `x') if COUNTRY_DATA=="United States", treat(`T' 0 1) mediate(`M') sims(1000) vce(cluster RecordNo)
gen acme_con_eff_us = r(delta1)
gen acme_hi_con_eff_us = r(delta1hi)
gen acme_lo_con_eff_us = r(delta1lo)
gen acme_perc_con_eff_us = r(navg)


local x  promise_2  promise_3
local T promise_4
local M trust_send
local Y elec_prom
medeff (regress `M' `T' `x') (logit `Y' `T' `M' `x') if COUNTRY_DATA=="United States", treat(`T' 0 1) mediate(`M') sims(1000) vce(cluster RecordNo)
gen acme_con_tru_us = r(delta1)
gen acme_hi_con_tru_us = r(delta1hi)
gen acme_lo_con_tru_us = r(delta1lo)
gen acme_perc_con_tru_us = r(navg)


* Eng *
local x  promise_2  promise_3
local T promise_4
local M send_prior
local Y elec_prom
medeff (regress `M' `T' `x') (logit `Y' `T' `M' `x') if COUNTRY_DATA=="Britain", treat(`T' 0 1) mediate(`M') sims(1000) vce(cluster RecordNo)
gen acme_con_pri_eng = r(delta1)
gen acme_hi_con_pri_eng = r(delta1hi)
gen acme_lo_con_pri_eng = r(delta1lo)
gen acme_perc_con_pri_eng = r(navg)


local x  promise_2  promise_3
local T promise_4
local M pol_real
local Y elec_prom
medeff (regress `M' `T' `x') (logit `Y' `T' `M' `x') if COUNTRY_DATA=="Britain", treat(`T' 0 1) mediate(`M') sims(1000) vce(cluster RecordNo)
gen acme_con_rea_eng = r(delta1)
gen acme_hi_con_rea_eng = r(delta1hi)
gen acme_lo_con_rea_eng = r(delta1lo)
gen acme_perc_con_rea_eng = r(navg)
  

local x  promise_2  promise_3
local T promise_4
local M nocontr
local Y elec_prom
medeff (regress `M' `T' `x') (logit `Y' `T' `M' `x') if COUNTRY_DATA=="Britain", treat(`T' 0 1) mediate(`M') sims(1000) vce(cluster RecordNo)
gen acme_con_eff_eng = r(delta1)
gen acme_hi_con_eff_eng = r(delta1hi)
gen acme_lo_con_eff_eng = r(delta1lo)
gen acme_perc_con_eff_eng = r(navg)


local x  promise_2  promise_3
local T promise_4
local M trust_send
local Y elec_prom
medeff (regress `M' `T' `x') (logit `Y' `T' `M' `x') if COUNTRY_DATA=="Britain", treat(`T' 0 1) mediate(`M') sims(1000) vce(cluster RecordNo)
gen acme_con_tru_eng = r(delta1)
gen acme_hi_con_tru_eng = r(delta1hi)
gen acme_lo_con_tru_eng = r(delta1lo)
gen acme_perc_con_tru_eng = r(navg)

* DK *
local x  promise_2  promise_3
local T promise_4
local M send_prior
local Y elec_prom
medeff (regress `M' `T' `x') (logit `Y' `T' `M' `x') if COUNTRY_DATA=="Denmark", treat(`T' 0 1) mediate(`M') sims(1000) vce(cluster RecordNo)
gen acme_con_pri_dk = r(delta1)
gen acme_hi_con_pri_dk = r(delta1hi)
gen acme_lo_con_pri_dk = r(delta1lo)
gen acme_perc_con_pri_dk = r(navg)


local x  promise_2  promise_3
local T promise_4
local M pol_real
local Y elec_prom
medeff (regress `M' `T' `x') (logit `Y' `T' `M' `x') if COUNTRY_DATA=="Denmark", treat(`T' 0 1) mediate(`M') sims(1000) vce(cluster RecordNo)
gen acme_con_rea_dk = r(delta1)
gen acme_hi_con_rea_dk = r(delta1hi)
gen acme_lo_con_rea_dk = r(delta1lo)
gen acme_perc_con_rea_dk = r(navg)
  

local x  promise_2  promise_3
local T promise_4
local M nocontr
local Y elec_prom
medeff (regress `M' `T' `x') (logit `Y' `T' `M' `x') if COUNTRY_DATA=="Denmark", treat(`T' 0 1) mediate(`M') sims(1000) vce(cluster RecordNo)
gen acme_con_eff_dk = r(delta1)
gen acme_hi_con_eff_dk = r(delta1hi)
gen acme_lo_con_eff_dk = r(delta1lo)
gen acme_perc_con_eff_dk = r(navg)


local x  promise_2  promise_3
local T promise_4
local M trust_send
local Y elec_prom
medeff (regress `M' `T' `x') (logit `Y' `T' `M' `x') if COUNTRY_DATA=="Denmark", treat(`T' 0 1) mediate(`M') sims(1000) vce(cluster RecordNo)
gen acme_con_tru_dk = r(delta1)
gen acme_hi_con_tru_dk = r(delta1hi)
gen acme_lo_con_tru_dk = r(delta1lo)
gen acme_perc_con_tru_dk = r(navg)


*** Generate graph variables ***
foreach c in us eng dk {
local m con

gen acme_`m'_all_`c' = .
gen acme_hi_`m'_all_`c' = .
gen acme_lo_`m'_all_`c' = .
gen acme_perc_`m'_all_`c' = .

foreach var in acme_`m' acme_hi_`m' acme_lo_`m' acme_perc_`m' {
replace `var'_all_`c' = `var'_pri_`c' if round ==1  
replace `var'_all_`c' = `var'_tru_`c' if round ==2  
replace `var'_all_`c' = `var'_rea_`c' if round ==3  
replace `var'_all_`c' = `var'_eff_`c' if round ==4  
}

replace acme_perc_`m'_all_`c' = acme_perc_`m'_all_`c'*100
}

*** Generate round variables ***
gen round_graph = round

expand 3

sort COUNTRY_DATA RecordNo round 

by COUNTRY_DATA RecordNo round: gen round_n = _n

order COUNTRY_DATA RecordNo round round_graph round_n

replace round_graph = round -0.2 if round_n==1 
replace round_graph = round +0.2 if round_n==3 

*** Generate graph variables (continued) ***
foreach var in acme_con_all acme_hi_con_all acme_lo_con_all acme_perc_con_all {
gen `var'=.
replace `var' = `var'_us if round_n ==1
replace `var' = `var'_eng if round_n ==2
replace `var' = `var'_dk if round_n ==3
}

save election_prom_pooled_stat_graph, replace

*** Graph ***
use election_prom_pooled_stat_graph, clear

twoway ///
(rspike acme_hi_con_all acme_lo_con_all round_graph if round_n==1, lcolor(black) lpattern(solid) lwidth(medium)) ///
(rspike acme_hi_con_all acme_lo_con_all round_graph if round_n==2, lcolor(gs6) lpattern(solid) lwidth(medium)) ///
(rspike acme_hi_con_all acme_lo_con_all round_graph if round_n==3, lcolor(gs10) lpattern(solid) lwidth(medium)) ///
(scatter acme_con_all round_graph if round_n==1, mcolor(black) msymbol(circle) msize(small)) ///
(scatter acme_con_all round_graph if round_n==2, mcolor(gs6) msymbol(circle) msize(small)) ///
(scatter acme_con_all round_graph if round_n==3, mcolor(gs10) msymbol(circle) msize(small)) ///
(bar acme_perc_con_all round_graph if round_n==1 & acme_perc_con_all>=0, color(black) lcolor(black) lwidth(none) barw(.08) yaxis(2)) ///
(bar acme_perc_con_all round_graph if round_n==2 & acme_perc_con_all>=0, color(gs6) lcolor(gs6) lwidth(none) barw(.08) yaxis(2)) ///
(bar acme_perc_con_all round_graph if round_n==3 & acme_perc_con_all>=0, color(gs10) lcolor(gs10) lwidth(none) barw(.08) yaxis(2)) ///
, ///
ylabel(-0.1(0.05)0.05, noticks labsize(vsmall) nogrid) ///
ylabel(0(20)100, noticks labsize(vsmall) axis(2)) ///
yscale(range(-0.1 0.05)) ///
xscale(range(0.7 4.3)) ///
plotregion(margin(zero)) ///
yline(0, lcolor(black) lpattern(shortdash) lwidth(thin)) ///
ytitle("ACME") ytitle(, size(small) margin(small)) ///
ytitle("% Mediated",  axis(2)) ytitle(, size(small) margin(small) axis(2)) ///
xtitle("") xtitle(, size(small) margin(vsmall)) ///
xlabel(1 "Priority" 2"Trust" 3 "Control" 4"Efficacy" , labsize(small) noticks) ///
legend(off) ///
graphregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white)) title("We think there should be", size(medium) margin(medium) color(black)) xsize(20) ysize(6) 

graph save m_stat, replace



graph export app_e2_statement.png, width(3000) replace





****************************** Conditionality **********************************

* Condition = economy *
use data_all, clear

* US *
local x cond_3 cond_4
local T cond_2
local M send_prior
local Y elec_prom
medeff (regress `M' `T' `x') (logit `Y' `T' `M' `x') if COUNTRY_DATA=="United States", treat(`T' 0 1) mediate(`M') sims(1000) vce(cluster RecordNo)
gen acme_con_pri_us = r(delta1)
gen acme_hi_con_pri_us = r(delta1hi)
gen acme_lo_con_pri_us = r(delta1lo)
gen acme_perc_con_pri_us = r(navg)


local x cond_3 cond_4
local T cond_2
local M pol_real
local Y elec_prom
medeff (regress `M' `T' `x') (logit `Y' `T' `M' `x') if COUNTRY_DATA=="United States", treat(`T' 0 1) mediate(`M') sims(1000) vce(cluster RecordNo)
gen acme_con_rea_us = r(delta1)
gen acme_hi_con_rea_us = r(delta1hi)
gen acme_lo_con_rea_us = r(delta1lo)
gen acme_perc_con_rea_us = r(navg)
  

local x cond_3 cond_4
local T cond_2
local M nocontr
local Y elec_prom
medeff (regress `M' `T' `x') (logit `Y' `T' `M' `x') if COUNTRY_DATA=="United States", treat(`T' 0 1) mediate(`M') sims(1000) vce(cluster RecordNo)
gen acme_con_eff_us = r(delta1)
gen acme_hi_con_eff_us = r(delta1hi)
gen acme_lo_con_eff_us = r(delta1lo)
gen acme_perc_con_eff_us = r(navg)


local x cond_3 cond_4
local T cond_2
local M trust_send
local Y elec_prom
medeff (regress `M' `T' `x') (logit `Y' `T' `M' `x') if COUNTRY_DATA=="United States", treat(`T' 0 1) mediate(`M') sims(1000) vce(cluster RecordNo)
gen acme_con_tru_us = r(delta1)
gen acme_hi_con_tru_us = r(delta1hi)
gen acme_lo_con_tru_us = r(delta1lo)
gen acme_perc_con_tru_us = r(navg)


* Eng *
local x cond_3 cond_4
local T cond_2
local M send_prior
local Y elec_prom
medeff (regress `M' `T' `x') (logit `Y' `T' `M' `x') if COUNTRY_DATA=="Britain", treat(`T' 0 1) mediate(`M') sims(1000) vce(cluster RecordNo)
gen acme_con_pri_eng = r(delta1)
gen acme_hi_con_pri_eng = r(delta1hi)
gen acme_lo_con_pri_eng = r(delta1lo)
gen acme_perc_con_pri_eng = r(navg)


local x cond_3 cond_4
local T cond_2
local M pol_real
local Y elec_prom
medeff (regress `M' `T' `x') (logit `Y' `T' `M' `x') if COUNTRY_DATA=="Britain", treat(`T' 0 1) mediate(`M') sims(1000) vce(cluster RecordNo)
gen acme_con_rea_eng = r(delta1)
gen acme_hi_con_rea_eng = r(delta1hi)
gen acme_lo_con_rea_eng = r(delta1lo)
gen acme_perc_con_rea_eng = r(navg)
  

local x cond_3 cond_4
local T cond_2
local M nocontr
local Y elec_prom
medeff (regress `M' `T' `x') (logit `Y' `T' `M' `x') if COUNTRY_DATA=="Britain", treat(`T' 0 1) mediate(`M') sims(1000) vce(cluster RecordNo)
gen acme_con_eff_eng = r(delta1)
gen acme_hi_con_eff_eng = r(delta1hi)
gen acme_lo_con_eff_eng = r(delta1lo)
gen acme_perc_con_eff_eng = r(navg)


local x cond_3 cond_4
local T cond_2
local M trust_send
local Y elec_prom
medeff (regress `M' `T' `x') (logit `Y' `T' `M' `x') if COUNTRY_DATA=="Britain", treat(`T' 0 1) mediate(`M') sims(1000) vce(cluster RecordNo)
gen acme_con_tru_eng = r(delta1)
gen acme_hi_con_tru_eng = r(delta1hi)
gen acme_lo_con_tru_eng = r(delta1lo)
gen acme_perc_con_tru_eng = r(navg)

* DK *
local x cond_3 cond_4
local T cond_2
local M send_prior
local Y elec_prom
medeff (regress `M' `T' `x') (logit `Y' `T' `M' `x') if COUNTRY_DATA=="Denmark", treat(`T' 0 1) mediate(`M') sims(1000) vce(cluster RecordNo)
gen acme_con_pri_dk = r(delta1)
gen acme_hi_con_pri_dk = r(delta1hi)
gen acme_lo_con_pri_dk = r(delta1lo)
gen acme_perc_con_pri_dk = r(navg)


local x cond_3 cond_4
local T cond_2
local M pol_real
local Y elec_prom
medeff (regress `M' `T' `x') (logit `Y' `T' `M' `x') if COUNTRY_DATA=="Denmark", treat(`T' 0 1) mediate(`M') sims(1000) vce(cluster RecordNo)
gen acme_con_rea_dk = r(delta1)
gen acme_hi_con_rea_dk = r(delta1hi)
gen acme_lo_con_rea_dk = r(delta1lo)
gen acme_perc_con_rea_dk = r(navg)
  

local x cond_3 cond_4
local T cond_2
local M nocontr
local Y elec_prom
medeff (regress `M' `T' `x') (logit `Y' `T' `M' `x') if COUNTRY_DATA=="Denmark", treat(`T' 0 1) mediate(`M') sims(1000) vce(cluster RecordNo)
gen acme_con_eff_dk = r(delta1)
gen acme_hi_con_eff_dk = r(delta1hi)
gen acme_lo_con_eff_dk = r(delta1lo)
gen acme_perc_con_eff_dk = r(navg)


local x cond_3 cond_4
local T cond_2
local M trust_send
local Y elec_prom
medeff (regress `M' `T' `x') (logit `Y' `T' `M' `x') if COUNTRY_DATA=="Denmark", treat(`T' 0 1) mediate(`M') sims(1000) vce(cluster RecordNo)
gen acme_con_tru_dk = r(delta1)
gen acme_hi_con_tru_dk = r(delta1hi)
gen acme_lo_con_tru_dk = r(delta1lo)
gen acme_perc_con_tru_dk = r(navg)


*** Generate graph variables ***
foreach c in us eng dk {
local m con

gen acme_`m'_all_`c' = .
gen acme_hi_`m'_all_`c' = .
gen acme_lo_`m'_all_`c' = .
gen acme_perc_`m'_all_`c' = .

foreach var in acme_`m' acme_hi_`m' acme_lo_`m' acme_perc_`m' {
replace `var'_all_`c' = `var'_pri_`c' if round ==1  
replace `var'_all_`c' = `var'_tru_`c' if round ==2  
replace `var'_all_`c' = `var'_rea_`c' if round ==3  
replace `var'_all_`c' = `var'_eff_`c' if round ==4  
}

replace acme_perc_`m'_all_`c' = acme_perc_`m'_all_`c'*100
}

*** Generate round variables ***
gen round_graph = round

expand 3

sort COUNTRY_DATA RecordNo round 

by COUNTRY_DATA RecordNo round: gen round_n = _n

order COUNTRY_DATA RecordNo round round_graph round_n

replace round_graph = round -0.2 if round_n==1 
replace round_graph = round +0.2 if round_n==3 

*** Generate graph variables (continued) ***
foreach var in acme_con_all acme_hi_con_all acme_lo_con_all acme_perc_con_all {
gen `var'=.
replace `var' = `var'_us if round_n ==1
replace `var' = `var'_eng if round_n ==2
replace `var' = `var'_dk if round_n ==3
}

save election_prom_pooled_con_graph, replace

*** Graph ***
use election_prom_pooled_con_graph, clear

twoway ///
(rspike acme_hi_con_all acme_lo_con_all round_graph if round_n==1, lcolor(black) lpattern(solid) lwidth(medium)) ///
(rspike acme_hi_con_all acme_lo_con_all round_graph if round_n==2, lcolor(gs6) lpattern(solid) lwidth(medium)) ///
(rspike acme_hi_con_all acme_lo_con_all round_graph if round_n==3, lcolor(gs10) lpattern(solid) lwidth(medium)) ///
(scatter acme_con_all round_graph if round_n==1, mcolor(black) msymbol(circle) msize(small)) ///
(scatter acme_con_all round_graph if round_n==2, mcolor(gs6) msymbol(circle) msize(small)) ///
(scatter acme_con_all round_graph if round_n==3, mcolor(gs10) msymbol(circle) msize(small)) ///
(bar acme_perc_con_all round_graph if round_n==1 & acme_perc_con_all>=0, color(black) lcolor(black) lwidth(none) barw(.08) yaxis(2)) ///
(bar acme_perc_con_all round_graph if round_n==2 & acme_perc_con_all>=0, color(gs6) lcolor(gs6) lwidth(none) barw(.08) yaxis(2)) ///
(bar acme_perc_con_all round_graph if round_n==3 & acme_perc_con_all>=0, color(gs10) lcolor(gs10) lwidth(none) barw(.08) yaxis(2)) ///
, ///
ylabel(-0.1(0.05)0.05, noticks labsize(vsmall) nogrid) ///
ylabel(0(20)100, noticks labsize(vsmall) axis(2)) ///
yscale(range(-0.1 0.05)) ///
xscale(range(0.7 4.3)) ///
plotregion(margin(zero)) ///
yline(0, lcolor(black) lpattern(shortdash) lwidth(thin)) ///
ytitle("ACME") ytitle(, size(small) margin(small)) ///
ytitle("% Mediated",  axis(2)) ytitle(, size(small) margin(small) axis(2)) ///
xtitle("") xtitle(, size(small) margin(vsmall)) ///
xlabel(1 "Priority" 2"Trust" 3 "Control" 4"Efficacy" , labsize(small) noticks) ///
legend(off) ///
graphregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white)) title("Economy", size(medium) margin(medium) color(black)) xsize(20) ysize(6) 

graph save m_con, replace


* Condition = Majority *

use data_all, clear

* US *
local x cond_2 cond_4
local T cond_3
local M send_prior
local Y elec_prom
medeff (regress `M' `T' `x') (logit `Y' `T' `M' `x') if COUNTRY_DATA=="United States", treat(`T' 0 1) mediate(`M') sims(1000) vce(cluster RecordNo)
gen acme_con_pri_us = r(delta1)
gen acme_hi_con_pri_us = r(delta1hi)
gen acme_lo_con_pri_us = r(delta1lo)
gen acme_perc_con_pri_us = r(navg)


local x cond_2 cond_4
local T cond_3
local M pol_real
local Y elec_prom
medeff (regress `M' `T' `x') (logit `Y' `T' `M' `x') if COUNTRY_DATA=="United States", treat(`T' 0 1) mediate(`M') sims(1000) vce(cluster RecordNo)
gen acme_con_rea_us = r(delta1)
gen acme_hi_con_rea_us = r(delta1hi)
gen acme_lo_con_rea_us = r(delta1lo)
gen acme_perc_con_rea_us = r(navg)
  

local x cond_2 cond_4
local T cond_3
local M nocontr
local Y elec_prom
medeff (regress `M' `T' `x') (logit `Y' `T' `M' `x') if COUNTRY_DATA=="United States", treat(`T' 0 1) mediate(`M') sims(1000) vce(cluster RecordNo)
gen acme_con_eff_us = r(delta1)
gen acme_hi_con_eff_us = r(delta1hi)
gen acme_lo_con_eff_us = r(delta1lo)
gen acme_perc_con_eff_us = r(navg)


local x cond_2 cond_4
local T cond_3
local M trust_send
local Y elec_prom
medeff (regress `M' `T' `x') (logit `Y' `T' `M' `x') if COUNTRY_DATA=="United States", treat(`T' 0 1) mediate(`M') sims(1000) vce(cluster RecordNo)
gen acme_con_tru_us = r(delta1)
gen acme_hi_con_tru_us = r(delta1hi)
gen acme_lo_con_tru_us = r(delta1lo)
gen acme_perc_con_tru_us = r(navg)


* Eng *
local x cond_2 cond_4
local T cond_3
local M send_prior
local Y elec_prom
medeff (regress `M' `T' `x') (logit `Y' `T' `M' `x') if COUNTRY_DATA=="Britain", treat(`T' 0 1) mediate(`M') sims(1000) vce(cluster RecordNo)
gen acme_con_pri_eng = r(delta1)
gen acme_hi_con_pri_eng = r(delta1hi)
gen acme_lo_con_pri_eng = r(delta1lo)
gen acme_perc_con_pri_eng = r(navg)


local x cond_2 cond_4
local T cond_3
local M pol_real
local Y elec_prom
medeff (regress `M' `T' `x') (logit `Y' `T' `M' `x') if COUNTRY_DATA=="Britain", treat(`T' 0 1) mediate(`M') sims(1000) vce(cluster RecordNo)
gen acme_con_rea_eng = r(delta1)
gen acme_hi_con_rea_eng = r(delta1hi)
gen acme_lo_con_rea_eng = r(delta1lo)
gen acme_perc_con_rea_eng = r(navg)
  

local x cond_2 cond_4
local T cond_3
local M nocontr
local Y elec_prom
medeff (regress `M' `T' `x') (logit `Y' `T' `M' `x') if COUNTRY_DATA=="Britain", treat(`T' 0 1) mediate(`M') sims(1000) vce(cluster RecordNo)
gen acme_con_eff_eng = r(delta1)
gen acme_hi_con_eff_eng = r(delta1hi)
gen acme_lo_con_eff_eng = r(delta1lo)
gen acme_perc_con_eff_eng = r(navg)


local x cond_2 cond_4
local T cond_3
local M trust_send
local Y elec_prom
medeff (regress `M' `T' `x') (logit `Y' `T' `M' `x') if COUNTRY_DATA=="Britain", treat(`T' 0 1) mediate(`M') sims(1000) vce(cluster RecordNo)
gen acme_con_tru_eng = r(delta1)
gen acme_hi_con_tru_eng = r(delta1hi)
gen acme_lo_con_tru_eng = r(delta1lo)
gen acme_perc_con_tru_eng = r(navg)

* DK *
local x cond_2 cond_4
local T cond_3
local M send_prior
local Y elec_prom
medeff (regress `M' `T' `x') (logit `Y' `T' `M' `x') if COUNTRY_DATA=="Denmark", treat(`T' 0 1) mediate(`M') sims(1000) vce(cluster RecordNo)
gen acme_con_pri_dk = r(delta1)
gen acme_hi_con_pri_dk = r(delta1hi)
gen acme_lo_con_pri_dk = r(delta1lo)
gen acme_perc_con_pri_dk = r(navg)


local x cond_2 cond_4
local T cond_3
local M pol_real
local Y elec_prom
medeff (regress `M' `T' `x') (logit `Y' `T' `M' `x') if COUNTRY_DATA=="Denmark", treat(`T' 0 1) mediate(`M') sims(1000) vce(cluster RecordNo)
gen acme_con_rea_dk = r(delta1)
gen acme_hi_con_rea_dk = r(delta1hi)
gen acme_lo_con_rea_dk = r(delta1lo)
gen acme_perc_con_rea_dk = r(navg)
  

local x cond_2 cond_4
local T cond_3
local M nocontr
local Y elec_prom
medeff (regress `M' `T' `x') (logit `Y' `T' `M' `x') if COUNTRY_DATA=="Denmark", treat(`T' 0 1) mediate(`M') sims(1000) vce(cluster RecordNo)
gen acme_con_eff_dk = r(delta1)
gen acme_hi_con_eff_dk = r(delta1hi)
gen acme_lo_con_eff_dk = r(delta1lo)
gen acme_perc_con_eff_dk = r(navg)


local x cond_2 cond_4
local T cond_3
local M trust_send
local Y elec_prom
medeff (regress `M' `T' `x') (logit `Y' `T' `M' `x') if COUNTRY_DATA=="Denmark", treat(`T' 0 1) mediate(`M') sims(1000) vce(cluster RecordNo)
gen acme_con_tru_dk = r(delta1)
gen acme_hi_con_tru_dk = r(delta1hi)
gen acme_lo_con_tru_dk = r(delta1lo)
gen acme_perc_con_tru_dk = r(navg)


*** Generate graph variables ***
foreach c in us eng dk {
local m con

gen acme_`m'_all_`c' = .
gen acme_hi_`m'_all_`c' = .
gen acme_lo_`m'_all_`c' = .
gen acme_perc_`m'_all_`c' = .

foreach var in acme_`m' acme_hi_`m' acme_lo_`m' acme_perc_`m' {
replace `var'_all_`c' = `var'_pri_`c' if round ==1  
replace `var'_all_`c' = `var'_tru_`c' if round ==2  
replace `var'_all_`c' = `var'_rea_`c' if round ==3  
replace `var'_all_`c' = `var'_eff_`c' if round ==4  
}

replace acme_perc_`m'_all_`c' = acme_perc_`m'_all_`c'*100
}

*** Generate round variables ***
gen round_graph = round

expand 3

sort COUNTRY_DATA RecordNo round 

by COUNTRY_DATA RecordNo round: gen round_n = _n

order COUNTRY_DATA RecordNo round round_graph round_n

replace round_graph = round -0.2 if round_n==1 
replace round_graph = round +0.2 if round_n==3 

*** Generate graph variables (continued) ***
foreach var in acme_con_all acme_hi_con_all acme_lo_con_all acme_perc_con_all {
gen `var'=.
replace `var' = `var'_us if round_n ==1
replace `var' = `var'_eng if round_n ==2
replace `var' = `var'_dk if round_n ==3
}

save election_prom_pooled_maj_graph, replace

*** Graph ***
use election_prom_pooled_maj_graph, clear

twoway ///
(rspike acme_hi_con_all acme_lo_con_all round_graph if round_n==1, lcolor(black) lpattern(solid) lwidth(medium)) ///
(rspike acme_hi_con_all acme_lo_con_all round_graph if round_n==2, lcolor(gs6) lpattern(solid) lwidth(medium)) ///
(rspike acme_hi_con_all acme_lo_con_all round_graph if round_n==3, lcolor(gs10) lpattern(solid) lwidth(medium)) ///
(scatter acme_con_all round_graph if round_n==1, mcolor(black) msymbol(circle) msize(small)) ///
(scatter acme_con_all round_graph if round_n==2, mcolor(gs6) msymbol(circle) msize(small)) ///
(scatter acme_con_all round_graph if round_n==3, mcolor(gs10) msymbol(circle) msize(small)) ///
(bar acme_perc_con_all round_graph if round_n==1 & acme_perc_con_all>=0, color(black) lcolor(black) lwidth(none) barw(.08) yaxis(2)) ///
(bar acme_perc_con_all round_graph if round_n==2 & acme_perc_con_all>=0, color(gs6) lcolor(gs6) lwidth(none) barw(.08) yaxis(2)) ///
(bar acme_perc_con_all round_graph if round_n==3 & acme_perc_con_all>=0, color(gs10) lcolor(gs10) lwidth(none) barw(.08) yaxis(2)) ///
, ///
ylabel(-0.1(0.05)0.05, noticks labsize(vsmall) nogrid) ///
ylabel(0(20)100, noticks labsize(vsmall) axis(2)) ///
yscale(range(-0.1 0.05)) ///
xscale(range(0.7 4.3)) ///
plotregion(margin(zero)) ///
yline(0, lcolor(black) lpattern(shortdash) lwidth(thin)) ///
ytitle("ACME") ytitle(, size(small) margin(small)) ///
ytitle("% Mediated",  axis(2)) ytitle(, size(small) margin(small) axis(2)) ///
xtitle("") xtitle(, size(small) margin(vsmall)) ///
xlabel(1 "Priority" 2"Trust" 3 "Control" 4"Efficacy" , labsize(small) noticks) ///
legend(off) ///
graphregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white)) title("Majority", size(medium) margin(medium) color(black)) xsize(20) ysize(6) 

graph save m_maj, replace


* Condition = Opportunity *

use data_all, clear

* US *
local x cond_2 cond_3
local T cond_4
local M send_prior
local Y elec_prom
medeff (regress `M' `T' `x') (logit `Y' `T' `M' `x') if COUNTRY_DATA=="United States", treat(`T' 0 1) mediate(`M') sims(1000) vce(cluster RecordNo)
gen acme_con_pri_us = r(delta1)
gen acme_hi_con_pri_us = r(delta1hi)
gen acme_lo_con_pri_us = r(delta1lo)
gen acme_perc_con_pri_us = r(navg)


local x cond_2 cond_3
local T cond_4
local M pol_real
local Y elec_prom
medeff (regress `M' `T' `x') (logit `Y' `T' `M' `x') if COUNTRY_DATA=="United States", treat(`T' 0 1) mediate(`M') sims(1000) vce(cluster RecordNo)
gen acme_con_rea_us = r(delta1)
gen acme_hi_con_rea_us = r(delta1hi)
gen acme_lo_con_rea_us = r(delta1lo)
gen acme_perc_con_rea_us = r(navg)
  

local x cond_2 cond_3
local T cond_4
local M nocontr
local Y elec_prom
medeff (regress `M' `T' `x') (logit `Y' `T' `M' `x') if COUNTRY_DATA=="United States", treat(`T' 0 1) mediate(`M') sims(1000) vce(cluster RecordNo)
gen acme_con_eff_us = r(delta1)
gen acme_hi_con_eff_us = r(delta1hi)
gen acme_lo_con_eff_us = r(delta1lo)
gen acme_perc_con_eff_us = r(navg)


local x cond_2 cond_3
local T cond_4
local M trust_send
local Y elec_prom
medeff (regress `M' `T' `x') (logit `Y' `T' `M' `x') if COUNTRY_DATA=="United States", treat(`T' 0 1) mediate(`M') sims(1000) vce(cluster RecordNo)
gen acme_con_tru_us = r(delta1)
gen acme_hi_con_tru_us = r(delta1hi)
gen acme_lo_con_tru_us = r(delta1lo)
gen acme_perc_con_tru_us = r(navg)


* Eng *
local x cond_2 cond_3
local T cond_4
local M send_prior
local Y elec_prom
medeff (regress `M' `T' `x') (logit `Y' `T' `M' `x') if COUNTRY_DATA=="Britain", treat(`T' 0 1) mediate(`M') sims(1000) vce(cluster RecordNo)
gen acme_con_pri_eng = r(delta1)
gen acme_hi_con_pri_eng = r(delta1hi)
gen acme_lo_con_pri_eng = r(delta1lo)
gen acme_perc_con_pri_eng = r(navg)


local x cond_2 cond_3
local T cond_4
local M pol_real
local Y elec_prom
medeff (regress `M' `T' `x') (logit `Y' `T' `M' `x') if COUNTRY_DATA=="Britain", treat(`T' 0 1) mediate(`M') sims(1000) vce(cluster RecordNo)
gen acme_con_rea_eng = r(delta1)
gen acme_hi_con_rea_eng = r(delta1hi)
gen acme_lo_con_rea_eng = r(delta1lo)
gen acme_perc_con_rea_eng = r(navg)
  

local x cond_2 cond_3
local T cond_4
local M nocontr
local Y elec_prom
medeff (regress `M' `T' `x') (logit `Y' `T' `M' `x') if COUNTRY_DATA=="Britain", treat(`T' 0 1) mediate(`M') sims(1000) vce(cluster RecordNo)
gen acme_con_eff_eng = r(delta1)
gen acme_hi_con_eff_eng = r(delta1hi)
gen acme_lo_con_eff_eng = r(delta1lo)
gen acme_perc_con_eff_eng = r(navg)


local x cond_2 cond_3
local T cond_4
local M trust_send
local Y elec_prom
medeff (regress `M' `T' `x') (logit `Y' `T' `M' `x') if COUNTRY_DATA=="Britain", treat(`T' 0 1) mediate(`M') sims(1000) vce(cluster RecordNo)
gen acme_con_tru_eng = r(delta1)
gen acme_hi_con_tru_eng = r(delta1hi)
gen acme_lo_con_tru_eng = r(delta1lo)
gen acme_perc_con_tru_eng = r(navg)

* DK *
local x cond_2 cond_3
local T cond_4
local M send_prior
local Y elec_prom
medeff (regress `M' `T' `x') (logit `Y' `T' `M' `x') if COUNTRY_DATA=="Denmark", treat(`T' 0 1) mediate(`M') sims(1000) vce(cluster RecordNo)
gen acme_con_pri_dk = r(delta1)
gen acme_hi_con_pri_dk = r(delta1hi)
gen acme_lo_con_pri_dk = r(delta1lo)
gen acme_perc_con_pri_dk = r(navg)


local x cond_2 cond_3
local T cond_4
local M pol_real
local Y elec_prom
medeff (regress `M' `T' `x') (logit `Y' `T' `M' `x') if COUNTRY_DATA=="Denmark", treat(`T' 0 1) mediate(`M') sims(1000) vce(cluster RecordNo)
gen acme_con_rea_dk = r(delta1)
gen acme_hi_con_rea_dk = r(delta1hi)
gen acme_lo_con_rea_dk = r(delta1lo)
gen acme_perc_con_rea_dk = r(navg)
  

local x cond_2 cond_3
local T cond_4
local M nocontr
local Y elec_prom
medeff (regress `M' `T' `x') (logit `Y' `T' `M' `x') if COUNTRY_DATA=="Denmark", treat(`T' 0 1) mediate(`M') sims(1000) vce(cluster RecordNo)
gen acme_con_eff_dk = r(delta1)
gen acme_hi_con_eff_dk = r(delta1hi)
gen acme_lo_con_eff_dk = r(delta1lo)
gen acme_perc_con_eff_dk = r(navg)


local x cond_2 cond_3
local T cond_4
local M trust_send
local Y elec_prom
medeff (regress `M' `T' `x') (logit `Y' `T' `M' `x') if COUNTRY_DATA=="Denmark", treat(`T' 0 1) mediate(`M') sims(1000) vce(cluster RecordNo)
gen acme_con_tru_dk = r(delta1)
gen acme_hi_con_tru_dk = r(delta1hi)
gen acme_lo_con_tru_dk = r(delta1lo)
gen acme_perc_con_tru_dk = r(navg)


*** Generate graph variables ***
foreach c in us eng dk {
local m con

gen acme_`m'_all_`c' = .
gen acme_hi_`m'_all_`c' = .
gen acme_lo_`m'_all_`c' = .
gen acme_perc_`m'_all_`c' = .

foreach var in acme_`m' acme_hi_`m' acme_lo_`m' acme_perc_`m' {
replace `var'_all_`c' = `var'_pri_`c' if round ==1  
replace `var'_all_`c' = `var'_tru_`c' if round ==2  
replace `var'_all_`c' = `var'_rea_`c' if round ==3  
replace `var'_all_`c' = `var'_eff_`c' if round ==4  
}

replace acme_perc_`m'_all_`c' = acme_perc_`m'_all_`c'*100
}

*** Generate round variables ***
gen round_graph = round

expand 3

sort COUNTRY_DATA RecordNo round 

by COUNTRY_DATA RecordNo round: gen round_n = _n

order COUNTRY_DATA RecordNo round round_graph round_n

replace round_graph = round -0.2 if round_n==1 
replace round_graph = round +0.2 if round_n==3 

*** Generate graph variables (continued) ***
foreach var in acme_con_all acme_hi_con_all acme_lo_con_all acme_perc_con_all {
gen `var'=.
replace `var' = `var'_us if round_n ==1
replace `var' = `var'_eng if round_n ==2
replace `var' = `var'_dk if round_n ==3
}

save election_prom_pooled_opp_graph, replace

*** Graph ***
use election_prom_pooled_opp_graph, clear

twoway ///
(rspike acme_hi_con_all acme_lo_con_all round_graph if round_n==1, lcolor(black) lpattern(solid) lwidth(medium)) ///
(rspike acme_hi_con_all acme_lo_con_all round_graph if round_n==2, lcolor(gs6) lpattern(solid) lwidth(medium)) ///
(rspike acme_hi_con_all acme_lo_con_all round_graph if round_n==3, lcolor(gs10) lpattern(solid) lwidth(medium)) ///
(scatter acme_con_all round_graph if round_n==1, mcolor(black) msymbol(circle) msize(small)) ///
(scatter acme_con_all round_graph if round_n==2, mcolor(gs6) msymbol(circle) msize(small)) ///
(scatter acme_con_all round_graph if round_n==3, mcolor(gs10) msymbol(circle) msize(small)) ///
(bar acme_perc_con_all round_graph if round_n==1 & acme_perc_con_all>=0, color(black) lcolor(black) lwidth(none) barw(.08) yaxis(2)) ///
(bar acme_perc_con_all round_graph if round_n==2 & acme_perc_con_all>=0, color(gs6) lcolor(gs6) lwidth(none) barw(.08) yaxis(2)) ///
(bar acme_perc_con_all round_graph if round_n==3 & acme_perc_con_all>=0, color(gs10) lcolor(gs10) lwidth(none) barw(.08) yaxis(2)) ///
, ///
ylabel(-0.1(0.05)0.05, noticks labsize(vsmall) nogrid) ///
ylabel(0(20)100, noticks labsize(vsmall) axis(2)) ///
yscale(range(-0.1 0.05)) ///
xscale(range(0.7 4.3)) ///
plotregion(margin(zero)) ///
yline(0, lcolor(black) lpattern(shortdash) lwidth(thin)) ///
ytitle("ACME") ytitle(, size(small) margin(small)) ///
ytitle("% Mediated",  axis(2)) ytitle(, size(small) margin(small) axis(2)) ///
xtitle("") xtitle(, size(small) margin(vsmall)) ///
xlabel(1 "Priority" 2"Trust" 3 "Control" 4"Efficacy" , labsize(small) noticks) ///
legend(off) ///
graphregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white)) title("Opportunity", size(medium) margin(medium) color(black)) xsize(20) ysize(6) 

graph save m_opp, replace


graph combine m_con.gph m_maj.gph m_opp.gph , xsize(16) ysize(20) graphregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white) margin(tiny)) rows(3) cols(1) 



graph export app_e2_conditionality.png, width(3000) replace





******************************** Output/outcome ********************************
cls

use data_all, clear


local x 
local T output
local M send_prior
local Y elec_prom
medeff (regress `M' `T' `x') (logit `Y' `T' `M' `x') if COUNTRY_DATA=="United States", treat(`T' 0 1) mediate(`M') sims(1000) vce(cluster RecordNo)
gen acme_out_pri_us = r(delta1)
gen acme_hi_out_pri_us = r(delta1hi)
gen acme_lo_out_pri_us = r(delta1lo)
gen acme_perc_out_pri_us = r(navg)

local x 
local T output
local M pol_real
local Y elec_prom
medeff (regress `M' `T' `x') (logit `Y' `T' `M' `x') if COUNTRY_DATA=="United States", treat(`T' 0 1) mediate(`M') sims(1000) vce(cluster RecordNo)
gen acme_out_rea_us = r(delta1)
gen acme_hi_out_rea_us = r(delta1hi)
gen acme_lo_out_rea_us = r(delta1lo)
gen acme_perc_out_rea_us = r(navg)
 
local x 
local T output
local M nocontr
local Y elec_prom
medeff (regress `M' `T' `x') (logit `Y' `T' `M' `x') if COUNTRY_DATA=="United States", treat(`T' 0 1) mediate(`M') sims(1000) vce(cluster RecordNo)
gen acme_out_eff_us = r(delta1)
gen acme_hi_out_eff_us = r(delta1hi)
gen acme_lo_out_eff_us = r(delta1lo)
gen acme_perc_out_eff_us = r(navg)

local x 
local T output
local M trust_send
local Y elec_prom
medeff (regress `M' `T' `x') (logit `Y' `T' `M' `x') if COUNTRY_DATA=="United States", treat(`T' 0 1) mediate(`M') sims(1000) vce(cluster RecordNo)
gen acme_out_tru_us = r(delta1)
gen acme_hi_out_tru_us = r(delta1hi)
gen acme_lo_out_tru_us = r(delta1lo)
gen acme_perc_out_tru_us = r(navg)


local x 
local T output
local M send_prior
local Y elec_prom
medeff (regress `M' `T' `x') (logit `Y' `T' `M' `x') if COUNTRY_DATA=="Britain", treat(`T' 0 1) mediate(`M') sims(1000) vce(cluster RecordNo)
gen acme_out_pri_eng = r(delta1)
gen acme_hi_out_pri_eng = r(delta1hi)
gen acme_lo_out_pri_eng = r(delta1lo)
gen acme_perc_out_pri_eng = r(navg)


local x 
local T output
local M pol_real
local Y elec_prom
medeff (regress `M' `T' `x') (logit `Y' `T' `M' `x') if COUNTRY_DATA=="Britain", treat(`T' 0 1) mediate(`M') sims(1000) vce(cluster RecordNo)
gen acme_out_rea_eng = r(delta1)
gen acme_hi_out_rea_eng = r(delta1hi)
gen acme_lo_out_rea_eng = r(delta1lo)
gen acme_perc_out_rea_eng = r(navg)
  

local x 
local T output
local M nocontr
local Y elec_prom
medeff (regress `M' `T' `x') (logit `Y' `T' `M' `x') if COUNTRY_DATA=="Britain", treat(`T' 0 1) mediate(`M') sims(1000) vce(cluster RecordNo)
gen acme_out_eff_eng = r(delta1)
gen acme_hi_out_eff_eng = r(delta1hi)
gen acme_lo_out_eff_eng = r(delta1lo)
gen acme_perc_out_eff_eng = r(navg)

local x 
local T output
local M trust_send
local Y elec_prom
medeff (regress `M' `T' `x') (logit `Y' `T' `M' `x') if COUNTRY_DATA=="Britain", treat(`T' 0 1) mediate(`M') sims(1000) vce(cluster RecordNo)
gen acme_out_tru_eng = r(delta1)
gen acme_hi_out_tru_eng = r(delta1hi)
gen acme_lo_out_tru_eng = r(delta1lo)
gen acme_perc_out_tru_eng = r(navg)


local x 
local T output
local M send_prior
local Y elec_prom
medeff (regress `M' `T' `x') (logit `Y' `T' `M' `x') if COUNTRY_DATA=="Denmark", treat(`T' 0 1) mediate(`M') sims(1000) vce(cluster RecordNo)
gen acme_out_pri_dk = r(delta1)
gen acme_hi_out_pri_dk = r(delta1hi)
gen acme_lo_out_pri_dk = r(delta1lo)
gen acme_perc_out_pri_dk = r(navg)


local x 
local T output
local M pol_real
local Y elec_prom
medeff (regress `M' `T' `x') (logit `Y' `T' `M' `x') if COUNTRY_DATA=="Denmark", treat(`T' 0 1) mediate(`M') sims(1000) vce(cluster RecordNo)
gen acme_out_rea_dk = r(delta1)
gen acme_hi_out_rea_dk = r(delta1hi)
gen acme_lo_out_rea_dk = r(delta1lo)
gen acme_perc_out_rea_dk = r(navg)
  

local x 
local T output
local M nocontr
local Y elec_prom
medeff (regress `M' `T' `x') (logit `Y' `T' `M' `x') if COUNTRY_DATA=="Denmark", treat(`T' 0 1) mediate(`M') sims(1000) vce(cluster RecordNo)
gen acme_out_eff_dk = r(delta1)
gen acme_hi_out_eff_dk = r(delta1hi)
gen acme_lo_out_eff_dk = r(delta1lo)
gen acme_perc_out_eff_dk = r(navg)


local x 
local T output
local M trust_send
local Y elec_prom
medeff (regress `M' `T' `x') (logit `Y' `T' `M' `x') if COUNTRY_DATA=="Denmark", treat(`T' 0 1) mediate(`M') sims(1000) vce(cluster RecordNo)
gen acme_out_tru_dk = r(delta1)
gen acme_hi_out_tru_dk = r(delta1hi)
gen acme_lo_out_tru_dk = r(delta1lo)
gen acme_perc_out_tru_dk = r(navg)


*** Generate graph variables ***
foreach c in us eng dk {
local m out

gen acme_`m'_all_`c' = .
gen acme_hi_`m'_all_`c' = .
gen acme_lo_`m'_all_`c' = .
gen acme_perc_`m'_all_`c' = .

foreach var in acme_`m' acme_hi_`m' acme_lo_`m' acme_perc_`m' {
replace `var'_all_`c' = `var'_pri_`c' if round ==1  
replace `var'_all_`c' = `var'_tru_`c' if round ==2  
replace `var'_all_`c' = `var'_rea_`c' if round ==3  
replace `var'_all_`c' = `var'_eff_`c' if round ==4  
}

replace acme_perc_`m'_all_`c' = acme_perc_`m'_all_`c'*100
}

*** Generate round variables ***
gen round_graph = round

expand 3

sort COUNTRY_DATA RecordNo round 

by COUNTRY_DATA RecordNo round: gen round_n = _n

order COUNTRY_DATA RecordNo round round_graph round_n

replace round_graph = round -0.2 if round_n==1 
replace round_graph = round +0.2 if round_n==3 


*** Generate graph variables (continued) ***
foreach var in acme_out_all acme_hi_out_all acme_lo_out_all acme_perc_out_all {
gen `var'=.
replace `var' = `var'_us if round_n ==1
replace `var' = `var'_eng if round_n ==2
replace `var' = `var'_dk if round_n ==3
}

save election_prom_pooled_out_graph, replace


*** Graph ***
use election_prom_pooled_out_graph, clear

twoway ///
(rspike acme_hi_out_all acme_lo_out_all round_graph if round_n==1, lcolor(black) lpattern(solid) lwidth(medium)) ///
(rspike acme_hi_out_all acme_lo_out_all round_graph if round_n==2, lcolor(gs6) lpattern(solid) lwidth(medium)) ///
(rspike acme_hi_out_all acme_lo_out_all round_graph if round_n==3, lcolor(gs10) lpattern(solid) lwidth(medium)) ///
(scatter acme_out_all round_graph if round_n==1, mcolor(black) msymbol(circle) msize(small)) ///
(scatter acme_out_all round_graph if round_n==2, mcolor(gs6) msymbol(circle) msize(small)) ///
(scatter acme_out_all round_graph if round_n==3, mcolor(gs10) msymbol(circle) msize(small)) ///
(bar acme_perc_out_all round_graph if round_n==1 & acme_perc_out_all>=0, color(black) lcolor(black) lwidth(none) barw(.08) yaxis(2)) ///
(bar acme_perc_out_all round_graph if round_n==2 & acme_perc_out_all>=0, color(gs6) lcolor(gs6) lwidth(none) barw(.08) yaxis(2)) ///
(bar acme_perc_out_all round_graph if round_n==3 & acme_perc_out_all>=0, color(gs10) lcolor(gs10) lwidth(none) barw(.08) yaxis(2)) ///
, ///
ylabel(-0.1(0.05)0.05, noticks labsize(vsmall) nogrid) ///
ylabel(0(20)100, noticks labsize(vsmall) axis(2)) ///
yscale(range(-0.1 0.05)) ///
xscale(range(0.7 4.3)) ///
plotregion(margin(zero)) ///
yline(0, lcolor(black) lpattern(shortdash) lwidth(thin)) ///
ytitle("ACME") ytitle(, size(small) margin(small)) ///
ytitle("% Mediated",  axis(2)) ytitle(, size(small) margin(small) axis(2)) ///
xtitle("") xtitle(, size(small) margin(vsmall)) ///
xlabel(1 "Priority" 2"Trust" 3 "Control" 4"Efficacy" , labsize(small) noticks) ///
legend(off) ///
graphregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white)) title("Output/outcome", size(medium) margin(medium) color(black)) xsize(20) ysize(6)
graph save m_out, replace



graph export app_e2_output.png, width(3000) replace





*** all graphs ***
graph combine m_stat.gph m_con.gph m_maj.gph m_opp.gph m_out.gph, xsize(14) ysize(20) graphregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white) margin(tiny)) rows(3) cols(1) 


graph export app_e1_all_output.png, width(3000) replace




********************************************************************************
***************** Appendix F1: election pledge and accountability **************
********************************************************************************

*** cross correlations
cls
use data_dk, clear
tab elec_prom pol_acc, row

use data_uk, clear
tab elec_prom pol_acc, row


use data_us, clear
tab elec_prom pol_acc, row



*** control for party choice ***

cls
use data_us, clear
reg pol_acc vote_sender i.sender, cluster(RecordNo)
estimates store send_us

reg pol_acc i.promise i.sender, cluster(RecordNo)
estimates store prom_us

reg pol_acc i.spec i.sender, cluster(RecordNo)
estimates store spec_us

reg pol_acc output i.sender, cluster(RecordNo)
estimates store out_us

reg pol_acc ib2.time i.sender, cluster(RecordNo)
estimates store time_us

reg pol_acc i.cond i.sender, cluster(RecordNo)
estimates store cond_us


use data_uk, clear
reg pol_acc vote_sender i.sender, cluster(RecordNo)
estimates store send_en

reg pol_acc i.promise i.sender, cluster(RecordNo)
estimates store prom_en

reg pol_acc i.spec i.sender, cluster(RecordNo)
estimates store spec_en

reg pol_acc output i.sender, cluster(RecordNo)
estimates store out_en

reg pol_acc ib2.time i.sender, cluster(RecordNo)
estimates store time_en

reg pol_acc i.cond i.sender, cluster(RecordNo)
estimates store cond_en


use data_dk, clear
reg pol_acc vote_sender i.sender, cluster(RecordNo)
estimates store send_dk

reg pol_acc i.promise i.sender, cluster(RecordNo)
estimates store prom_dk

reg pol_acc i.spec i.sender, cluster(RecordNo)
estimates store spec_dk

reg pol_acc output i.sender, cluster(RecordNo)
estimates store out_dk

reg pol_acc ib2.time i.sender, cluster(RecordNo)
estimates store time_dk

reg pol_acc i.cond i.sender, cluster(RecordNo)
estimates store cond_dk


coefplot (send_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(prom_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(spec_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(out_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(time_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(cond_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(send_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(prom_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(spec_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(out_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(time_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(cond_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(send_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(prom_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(spec_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(out_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(time_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(cond_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))), ///
drop(*.sender _cons) yscale(noline alt) grid(glcolor(gs6) glwidth(vthin)) ///
headings(vote_sender = "{bf:Sender}" 1.promise = "{bf:Committing statement}" 1.spec = "{bf:Numeric goal}" 1.time = "{bf:Time horizon}" output = "{bf:Output/outcome}" 1.cond = "{bf:Conditionality}", labgap(-93) nogap labsize(vsmall)) ///
xline(0, lcolor(black) lpattern(shortdash)) ytitle("", size(small)) levels(95) ///
graphregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white) margin(l=30)) coeflabels(, notick labgap(-90)) ///
xsize(14) ysize(20) xlabel(-0.30(0.05)0.2, labsize(vsmall)) ylabel(, labsize(vsmall)) baselevels legend(off) msymbol(o) 




graph export acc_f2partycontrol.png, width(3000) replace



*** control for accountability ***


cls
use data_us, clear
reg pol_acc vote_sender gov, cluster(RecordNo)
estimates store send_us

reg pol_acc i.promise gov, cluster(RecordNo)
estimates store prom_us

reg pol_acc i.spec gov, cluster(RecordNo)
estimates store spec_us

reg pol_acc output gov, cluster(RecordNo)
estimates store out_us

reg pol_acc ib2.time gov, cluster(RecordNo)
estimates store time_us

reg pol_acc i.cond gov, cluster(RecordNo)
estimates store cond_us


use data_uk, clear
reg pol_acc vote_sender gov, cluster(RecordNo)
estimates store send_en

reg pol_acc i.promise gov, cluster(RecordNo)
estimates store prom_en

reg pol_acc i.spec gov, cluster(RecordNo)
estimates store spec_en

reg pol_acc output gov, cluster(RecordNo)
estimates store out_en

reg pol_acc ib2.time gov, cluster(RecordNo)
estimates store time_en

reg pol_acc i.cond gov, cluster(RecordNo)
estimates store cond_en


use data_dk, clear
reg pol_acc vote_sender gov, cluster(RecordNo)
estimates store send_dk

reg pol_acc i.promise gov, cluster(RecordNo)
estimates store prom_dk

reg pol_acc i.spec gov, cluster(RecordNo)
estimates store spec_dk

reg pol_acc output gov, cluster(RecordNo)
estimates store out_dk

reg pol_acc ib2.time gov, cluster(RecordNo)
estimates store time_dk

reg pol_acc i.cond gov, cluster(RecordNo)
estimates store cond_dk


coefplot (send_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(prom_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(spec_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(out_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(time_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(cond_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(send_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(prom_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(spec_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(out_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(time_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(cond_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(send_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(prom_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(spec_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(out_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(time_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(cond_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))), ///
drop(gov _cons) yscale(noline alt) grid(glcolor(gs6) glwidth(vthin)) ///
headings(vote_sender = "{bf:Sender}" 1.promise = "{bf:Committing statement}" 1.spec = "{bf:Numeric goal}" 1.time = "{bf:Time horizon}" output = "{bf:Output/outcome}" 1.cond = "{bf:Conditionality}", labgap(-93) nogap labsize(vsmall)) ///
xline(0, lcolor(black) lpattern(shortdash)) ytitle("", size(small)) levels(95) ///
graphregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white) margin(l=30)) coeflabels(, notick labgap(-90)) ///
xsize(14) ysize(20) xlabel(-0.30(0.05)0.2, labsize(vsmall)) ylabel(, labsize(vsmall)) baselevels legend(off) msymbol(o) 

 

graph export acc_f2governmentcontrol.png, width(3000) replace



*** control for party choice and accountability c opp ***

cls
use data_us, clear
reg pol_acc vote_sender if gov==0, cluster(RecordNo)
estimates store send_us

reg pol_acc i.promise if gov==0, cluster(RecordNo)
estimates store prom_us

reg pol_acc i.spec if gov==0, cluster(RecordNo)
estimates store spec_us

reg pol_acc output if gov==0, cluster(RecordNo)
estimates store out_us

reg pol_acc ib2.time if gov==0, cluster(RecordNo)
estimates store time_us

reg pol_acc i.cond if gov==0, cluster(RecordNo)
estimates store cond_us


use data_uk, clear
reg pol_acc vote_sender if gov==0, cluster(RecordNo)
estimates store send_en

reg pol_acc i.promise if gov==0, cluster(RecordNo)
estimates store prom_en

reg pol_acc i.spec if gov==0, cluster(RecordNo)
estimates store spec_en

reg pol_acc output if gov==0, cluster(RecordNo)
estimates store out_en

reg pol_acc ib2.time if gov==0, cluster(RecordNo)
estimates store time_en

reg pol_acc i.cond if gov==0, cluster(RecordNo)
estimates store cond_en


use data_dk, clear
reg pol_acc vote_sender if gov==0, cluster(RecordNo)
estimates store send_dk

reg pol_acc i.promise if gov==0, cluster(RecordNo)
estimates store prom_dk

reg pol_acc i.spec if gov==0, cluster(RecordNo)
estimates store spec_dk

reg pol_acc output if gov==0, cluster(RecordNo)
estimates store out_dk

reg pol_acc ib2.time if gov==0, cluster(RecordNo)
estimates store time_dk

reg pol_acc i.cond if gov==0, cluster(RecordNo)
estimates store cond_dk


coefplot (send_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(prom_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(spec_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(out_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(time_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(cond_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(send_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(prom_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(spec_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(out_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(time_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(cond_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(send_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(prom_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(spec_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(out_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(time_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(cond_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))), ///
drop(_cons) yscale(noline alt) grid(glcolor(gs6) glwidth(vthin)) ///
headings(vote_sender = "{bf:Sender}" 1.promise = "{bf:Committing statement}" 1.spec = "{bf:Numeric goal}" 1.time = "{bf:Time horizon}" output = "{bf:Output/outcome}" 1.cond = "{bf:Conditionality}", labgap(-93) nogap labsize(vsmall)) ///
xline(0, lcolor(black) lpattern(shortdash)) ytitle("", size(small)) levels(95) ///
graphregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white) margin(l=30)) coeflabels(, notick labgap(-90)) ///
xsize(14) ysize(20) xlabel(-0.30(0.05)0.2, labsize(vsmall)) ylabel(, labsize(vsmall)) baselevels legend(off) msymbol(o) 



graph export acc_f2c_opp.png, width(3000) replace



*** control for party choice and accountability c gov ***
cls
use data_us, clear
reg pol_acc vote_sender if gov==1, cluster(RecordNo)
estimates store send_us

reg pol_acc i.promise if gov==1, cluster(RecordNo)
estimates store prom_us

reg pol_acc i.spec if gov==1, cluster(RecordNo)
estimates store spec_us

reg pol_acc output if gov==1, cluster(RecordNo)
estimates store out_us

reg pol_acc ib2.time if gov==1, cluster(RecordNo)
estimates store time_us

reg pol_acc i.cond if gov==1, cluster(RecordNo)
estimates store cond_us


use data_uk, clear
reg pol_acc vote_sender if gov==1, cluster(RecordNo)
estimates store send_en

reg pol_acc i.promise if gov==1, cluster(RecordNo)
estimates store prom_en

reg pol_acc i.spec if gov==1, cluster(RecordNo)
estimates store spec_en

reg pol_acc output if gov==1, cluster(RecordNo)
estimates store out_en

reg pol_acc ib2.time if gov==1, cluster(RecordNo)
estimates store time_en

reg pol_acc i.cond if gov==1, cluster(RecordNo)
estimates store cond_en


use data_dk, clear
reg pol_acc vote_sender if gov==1, cluster(RecordNo)
estimates store send_dk

reg pol_acc i.promise if gov==1, cluster(RecordNo)
estimates store prom_dk

reg pol_acc i.spec if gov==1, cluster(RecordNo)
estimates store spec_dk

reg pol_acc output if gov==1, cluster(RecordNo)
estimates store out_dk

reg pol_acc ib2.time if gov==1, cluster(RecordNo)
estimates store time_dk

reg pol_acc i.cond if gov==1, cluster(RecordNo)
estimates store cond_dk


coefplot (send_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(prom_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(spec_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(out_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(time_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(cond_dk, offset(-0.3) color(gs10) ciopts(lcolor(gs10 gs10) lwidth(vthin))) ///
(send_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(prom_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(spec_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(out_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(time_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(cond_en, color(gs6) ciopts(lcolor(gs6 gs6) lwidth(vthin))) ///
(send_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(prom_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(spec_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(out_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(time_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))) ///
(cond_us, offset(0.3) color(black) ciopts(lcolor(black black) lwidth(vthin))), ///
drop(_cons) yscale(noline alt) grid(glcolor(gs6) glwidth(vthin)) ///
headings(vote_sender = "{bf:Sender}" 1.promise = "{bf:Committing statement}" 1.spec = "{bf:Numeric goal}" 1.time = "{bf:Time horizon}" output = "{bf:Output/outcome}" 1.cond = "{bf:Conditionality}", labgap(-93) nogap labsize(vsmall)) ///
xline(0, lcolor(black) lpattern(shortdash)) ytitle("", size(small)) levels(95) ///
graphregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white) margin(l=30)) coeflabels(, notick labgap(-90)) ///
xsize(14) ysize(20) xlabel(-0.30(0.05)0.2, labsize(vsmall)) ylabel(, labsize(vsmall)) baselevels legend(off) msymbol(o) 



graph export acc_f2c_gov.png, width(3000) replace
















